-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests + AddGraphProgram tool + various fixes
- Loading branch information
1 parent
8b0ffff
commit 759b2d4
Showing
18 changed files
with
403 additions
and
102 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# Graph Interpreter Agent | ||
|
||
The `GraphInterpreterAgent` is the agent system that execute the Cypher software stored in memory, it can branch over the graph programs by asking itself question when encountering decision steps, and use tools when encountering an Action step and jump to other programs when encountering Program steps. | ||
|
||
## Usage | ||
|
||
```python | ||
from hybridagi.modules.agents import GraphInterpreterAgent | ||
from hybridagi.core.datatypes import AgentState | ||
from hybridagi.modules.agents.tools import PredictTool, SpeakTool | ||
|
||
agent_state = AgentState() | ||
|
||
tools = [ | ||
PredictTool(), | ||
SpeakTool( | ||
agent_state = agent_state, | ||
) | ||
] | ||
|
||
agent = GraphInterpreterAgent( | ||
agent_state = agent_state, # The agent state | ||
program_memory = program_memory, # The program memory where the graph programs are stored | ||
embeddings = None, # The embeddings to use when storing the agent steps (optional, default to None) | ||
trace_memory = None, # The trace memory to store the agent steps (optional, default to None) | ||
tools = tools, # The list of tools to use for the agent | ||
entrypoint = "main" # The entrypoint for the graph programs (default to main) | ||
num_history = 5, # The number of last steps to remember in the agent context (Default to 5) | ||
commit_decision_steps = False, # Weither or not to use the decision steps in the agent context (default to False) | ||
decision_lm = None, # The decision language model to use if different from the one configured (optional, default to None) | ||
verbose = True, # Weither or not to display the colorful trace when executing the program (default to True) | ||
debug = False, # Weither or not to raise exceptions during the execution of a program (default to False) | ||
) | ||
|
||
result = agent(Query(text="What is the capital of France?")) | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
|
||
|
||
The `AskUser` Tool is usefull to ask information to the user and | ||
|
||
## Output | ||
|
||
```python | ||
``` | ||
|
||
## Usage | ||
|
||
```python | ||
|
||
ask_user = AskUserTool( | ||
name = "AskUser" # The name of the tool | ||
agent_state = agent_state, # The state of the agent | ||
simulated = True, # Weither or not to simulate the user using a LLM | ||
func = None, # Callable function to integrate with front-end (optional) | ||
lm = | ||
) | ||
``` | ||
|
||
### Integrate it with Gradio | ||
|
||
TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# TODO |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# TODO |
Oops, something went wrong.