start implementation on new architecture

This commit is contained in:
2024-11-01 09:56:30 +01:00
parent ee089e5be7
commit 2c1e134c6e
43 changed files with 2978 additions and 619 deletions

View File

@@ -318,7 +318,7 @@ stateDiagram-v2
```mermaid
classDiagram
direction LR
direction LR
class BaseAgent {
<<abstract>>
#working_memory WorkingMemory
@@ -331,8 +331,8 @@ classDiagram
}
class LLMEngine {
+LLMEngine(path str)
+set_model_path(path str)
+LLMEngine(model_path str)
+set_model_path(model_path str)
+inference(context str) Iterator~str~
}
@@ -348,14 +348,15 @@ classDiagram
}
class WebAgentState {
<<enumeration>>
UPDATE
CONTEXT_APPROVAL
INFERENCE
RESPONSE_APPROVAL
<<enumeration>>
UPDATE
CONTEXT_APPROVAL
INFERENCE
RESPONSE_APPROVAL
}
class WorkingMemory {
+WorkingMemory()
-entries List~Entry~
+add_entry(entry Entry)
+remove_entry(id str)
@@ -369,12 +370,13 @@ classDiagram
class XMLValidator {
-schema ElementTree
+XMLValidator(schema_path str)
+XMLValidator(schema str)
+validate(xml str) Optional~str~
}
class ResponseParser {
-io_buffer IOBuffer
+ResponseParser(io_buffer IOBuffer)
+parse(xml str) Command | Entry
}
@@ -382,6 +384,7 @@ classDiagram
<<abstract>>
+id str
+timestamp datetime
+Entry(id str, timestamp datetime)
+update()*
+generate_context() ElementTree*
}
@@ -391,6 +394,7 @@ classDiagram
+stdout str
+stderr str
+exit_code int
+SingleShotEntry(script str, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
@@ -400,6 +404,7 @@ classDiagram
+stdout str
+stderr str
+exit_code int
+RepeatEntry(script str, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
@@ -409,12 +414,14 @@ classDiagram
+stdout str
+stderr str
+process Process
+BackgroundEntry(script str, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
class ReasoningEntry {
+content str
+ReasoningEntry(content str, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
@@ -422,18 +429,21 @@ classDiagram
class ParseErrorEntry {
+content str
+error str
+ParseErrorEntry(content str, error str, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
class ReadEntry {
+content str
+ReadEntry(io_buffer IOBuffer, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
class WriteEntry {
+content str
+WriteEntry(content str, io_buffer IOBuffer, id str, timestamp datetime)
+update()
+generate_context() ElementTree
}
@@ -446,6 +456,7 @@ classDiagram
}
class StandardIOBuffer {
+StandardIOBuffer()
+read() str
+write(content str)
+buffer_length() int
@@ -454,6 +465,7 @@ classDiagram
class WebIOBuffer {
-stdin_buffer str
-stdout_buffer str
+WebIOBuffer()
+read() str
+write(content str)
+buffer_length() int
@@ -462,23 +474,35 @@ classDiagram
+clear_stdout()
}
class CommandResult {
+should_stop bool
+success bool
+message str
+CommandResult(should_stop bool, success bool, message str)
+static success() CommandResult
+static failure(message str) CommandResult
+static stop() CommandResult
}
class Command {
<<abstract>>
+execute(memory &WorkingMemory)*
+execute(memory &WorkingMemory) CommandResult*
}
class DeleteCommand {
+id: str
+execute(memory &WorkingMemory)
+id str
+DeleteCommand(id str)
+execute(memory &WorkingMemory) CommandResult
}
class StopCommand {
+execute(memory &WorkingMemory)
+execute(memory &WorkingMemory) CommandResult
}
class WebServer {
-agent WebAgent
-clients List~WebSocket~
+WebServer(agent WebAgent)
-broadcast_state_change()
}
@@ -491,7 +515,6 @@ classDiagram
BaseAgent "1" *-- "1" LLMEngine
BaseAgent "1" *-- "1" ResponseParser
WebServer "1" *-- "1" WebIOBuffer
WebServer "1" *-- "1" WebAgent
@@ -509,7 +532,7 @@ classDiagram
Command <|-- DeleteCommand
Command <|-- StopCommand
Command -- CommandResult
IOBuffer <|.. WebIOBuffer
IOBuffer <|.. StandardIOBuffer