|
|
|
@ -269,3 +269,65 @@ tasks = [
|
|
|
|
|
responses = agent.bulk_run(tasks)
|
|
|
|
|
print(responses)
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Various other settings
|
|
|
|
|
|
|
|
|
|
```python
|
|
|
|
|
# # Convert the agent object to a dictionary
|
|
|
|
|
print(agent.to_dict())
|
|
|
|
|
print(agent.to_toml())
|
|
|
|
|
print(agent.model_dump_json())
|
|
|
|
|
print(agent.model_dump_yaml())
|
|
|
|
|
|
|
|
|
|
# Ingest documents into the agent's knowledge base
|
|
|
|
|
agent.ingest_docs("your_pdf_path.pdf")
|
|
|
|
|
|
|
|
|
|
# Receive a message from a user and process it
|
|
|
|
|
agent.receive_message(name="agent_name", message="message")
|
|
|
|
|
|
|
|
|
|
# Send a message from the agent to a user
|
|
|
|
|
agent.send_agent_message(agent_name="agent_name", message="message")
|
|
|
|
|
|
|
|
|
|
# Ingest multiple documents into the agent's knowledge base
|
|
|
|
|
agent.ingest_docs("your_pdf_path.pdf", "your_csv_path.csv")
|
|
|
|
|
|
|
|
|
|
# Run the agent with a filtered system prompt
|
|
|
|
|
agent.filtered_run(
|
|
|
|
|
"How can I establish a ROTH IRA to buy stocks and get a tax break? What are the criteria?"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Run the agent with multiple system prompts
|
|
|
|
|
agent.bulk_run(
|
|
|
|
|
[
|
|
|
|
|
"How can I establish a ROTH IRA to buy stocks and get a tax break? What are the criteria?",
|
|
|
|
|
"Another system prompt",
|
|
|
|
|
]
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
# Add a memory to the agent
|
|
|
|
|
agent.add_memory("Add a memory to the agent")
|
|
|
|
|
|
|
|
|
|
# Check the number of available tokens for the agent
|
|
|
|
|
agent.check_available_tokens()
|
|
|
|
|
|
|
|
|
|
# Perform token checks for the agent
|
|
|
|
|
agent.tokens_checks()
|
|
|
|
|
|
|
|
|
|
# Print the dashboard of the agent
|
|
|
|
|
agent.print_dashboard()
|
|
|
|
|
|
|
|
|
|
# Print the history and memory of the agent
|
|
|
|
|
agent.print_history_and_memory()
|
|
|
|
|
|
|
|
|
|
# Fetch all the documents from the doc folders
|
|
|
|
|
agent.get_docs_from_doc_folders()
|
|
|
|
|
|
|
|
|
|
# Activate agent ops
|
|
|
|
|
agent.activate_agentops()
|
|
|
|
|
agent.check_end_session_agentops()
|
|
|
|
|
|
|
|
|
|
# Dump the model to a JSON file
|
|
|
|
|
agent.model_dump_json()
|
|
|
|
|
print(agent.to_toml())
|
|
|
|
|
```
|