Skip to content

Building AI agents, atomically

update docs

KennyVaneetvelde55260522a840
diff --git a/docs/api/README.md b/docs/api/README.md
index aaa8e7b..1729a46 100644
--- a/docs/api/README.md
+++ b/docs/api/README.md
@@ -18,6 +18,7 @@ A full list of `Atomic_agents` project modules.
- [Base](atomic_agents/lib/tools/base.md#base)
- [CalculatorTool](atomic_agents/lib/tools/calculator_tool.md#calculatortool)
- [ContentScrapingTool](atomic_agents/lib/tools/content_scraping_tool.md#contentscrapingtool)
+ - [Yelp Restaurant Finder Tool](atomic_agents/lib/tools/yelp_restaurant_finder_tool.md#yelp-restaurant-finder-tool)
- [Yt Transcript Scraper](atomic_agents/lib/tools/yt_transcript_scraper.md#yt-transcript-scraper)
- [Utils](atomic_agents/lib/utils/index.md#utils)
- [Format Tool Message](atomic_agents/lib/utils/format_tool_message.md#format-tool-message)
diff --git a/docs/api/atomic_agents/agents/base_chat_agent.md b/docs/api/atomic_agents/agents/base_chat_agent.md
index 74e8afc..abe18c6 100644
--- a/docs/api/atomic_agents/agents/base_chat_agent.md
+++ b/docs/api/atomic_agents/agents/base_chat_agent.md
@@ -14,12 +14,13 @@
- [BaseChatAgent().get_system_prompt](#basechatagent()get_system_prompt)
- [BaseChatAgent().reset_memory](#basechatagent()reset_memory)
- [BaseChatAgent().run](#basechatagent()run)
+ - [BaseChatAgentConfig](#basechatagentconfig)
- [BaseChatAgentInputSchema](#basechatagentinputschema)
- [BaseChatAgentResponse](#basechatagentresponse)
## BaseChatAgent
-[Show source in base_chat_agent.py:21](../../../../atomic_agents/agents/base_chat_agent.py#L21)
+[Show source in base_chat_agent.py:34](../../../../atomic_agents/agents/base_chat_agent.py#L34)
Base class for chat agents.
@@ -42,26 +43,19 @@ generating system prompts, and obtaining responses from a language model.
class BaseChatAgent:
def __init__(
self,
- client,
- system_prompt_generator: SystemPromptGenerator = None,
- model: str = "gpt-3.5-turbo",
- memory: ChatMemory = None,
- include_planning_step=False,
- input_schema=BaseChatAgentInputSchema,
- output_schema=BaseChatAgentResponse,
+ config: BaseChatAgentConfig = BaseChatAgentConfig(
+ client=instructor.from_openai(openai.OpenAI())
+ ),
): ...
```
#### See also
-- [BaseChatAgentInputSchema](#basechatagentinputschema)
-- [BaseChatAgentResponse](#basechatagentresponse)
-- [ChatMemory](../lib/components/chat_memory.md#chatmemory)
-- [SystemPromptGenerator](../lib/components/system_prompt_generator.md#systempromptgenerator)
+- [BaseChatAgentConfig](#basechatagentconfig)
### BaseChatAgent()._get_and_handle_response
-[Show source in base_chat_agent.py:111](../../../../atomic_agents/agents/base_chat_agent.py#L111)
+[Show source in base_chat_agent.py:119](../../../../atomic_agents/agents/base_chat_agent.py#L119)
Handles obtaining and processing the response.
@@ -77,7 +71,7 @@ def _get_and_handle_response(self): ...
### BaseChatAgent()._init_run
-[Show source in base_chat_agent.py:121](../../../../atomic_agents/agents/base_chat_agent.py#L121)
+[Show source in base_chat_agent.py:129](../../../../atomic_agents/agents/base_chat_agent.py#L129)
Initializes the run with the given user input.
@@ -93,7 +87,7 @@ def _init_run(self, user_input): ...
### BaseChatAgent()._post_run
-[Show source in base_chat_agent.py:136](../../../../atomic_agents/agents/base_chat_agent.py#L136)
+[Show source in base_chat_agent.py:144](../../../../atomic_agents/agents/base_chat_agent.py#L144)
Finalizes the run with the given response.
@@ -109,7 +103,7 @@ def _post_run(self, response): ...
### BaseChatAgent()._pre_run
-[Show source in base_chat_agent.py:130](../../../../atomic_agents/agents/base_chat_agent.py#L130)
+[Show source in base_chat_agent.py:138](../../../../atomic_agents/agents/base_chat_agent.py#L138)
Prepares for the run. This method can be overridden by subclasses to add custom pre-run logic.
@@ -121,7 +115,7 @@ def _pre_run(self): ...
### BaseChatAgent().get_response
-[Show source in base_chat_agent.py:73](../../../../atomic_agents/agents/base_chat_agent.py#L73)
+[Show source in base_chat_agent.py:81](../../../../atomic_agents/agents/base_chat_agent.py#L81)
Obtains a response from the language model.
@@ -141,7 +135,7 @@ def get_response(self, response_model=None) -> Type[BaseModel]: ...
### BaseChatAgent().get_system_prompt
-[Show source in base_chat_agent.py:64](../../../../atomic_agents/agents/base_chat_agent.py#L64)
+[Show source in base_chat_agent.py:72](../../../../atomic_agents/agents/base_chat_agent.py#L72)
Generates the system prompt.
@@ -157,7 +151,7 @@ def get_system_prompt(self) -> str: ...
### BaseChatAgent().reset_memory
-[Show source in base_chat_agent.py:58](../../../../atomic_agents/agents/base_chat_agent.py#L58)
+[Show source in base_chat_agent.py:66](../../../../atomic_agents/agents/base_chat_agent.py#L66)
Resets the memory to its initial state.
@@ -169,7 +163,7 @@ def reset_memory(self): ...
### BaseChatAgent().run
-[Show source in base_chat_agent.py:94](../../../../atomic_agents/agents/base_chat_agent.py#L94)
+[Show source in base_chat_agent.py:102](../../../../atomic_agents/agents/base_chat_agent.py#L102)
Runs the chat agent with the given user input.
@@ -189,9 +183,21 @@ def run(self, user_input: Optional[str] = None) -> str: ...
+## BaseChatAgentConfig
+
+[Show source in base_chat_agent.py:23](../../../../atomic_agents/agents/base_chat_agent.py#L23)
+
+#### Signature
+
+```python
+class BaseChatAgentConfig(BaseModel): ...
+```
+
+
+
## BaseChatAgentInputSchema
-[Show source in base_chat_agent.py:7](../../../../atomic_agents/agents/base_chat_agent.py#L7)
+[Show source in base_chat_agent.py:9](../../../../atomic_agents/agents/base_chat_agent.py#L9)
#### Signature
@@ -203,7 +209,7 @@ class BaseChatAgentInputSchema(BaseModel): ...
## BaseChatAgentResponse
-[Show source in base_chat_agent.py:10](../../../../atomic_agents/agents/base_chat_agent.py#L10)
+[Show source in base_chat_agent.py:12](../../../../atomic_agents/agents/base_chat_agent.py#L12)
#### Signature
diff --git a/docs/api/atomic_agents/agents/tool_interface_agent.md b/docs/api/atomic_agents/agents/tool_interface_agent.md
index 112d67b..02b7402 100644
--- a/docs/api/atomic_agents/agents/tool_interface_agent.md
+++ b/docs/api/atomic_agents/agents/tool_interface_agent.md
@@ -7,10 +7,11 @@
- [ToolInterfaceAgent](#toolinterfaceagent)
- [ToolInterfaceAgent](#toolinterfaceagent-1)
- [ToolInterfaceAgent()._get_and_handle_response](#toolinterfaceagent()_get_and_handle_response)
+ - [ToolInterfaceAgentConfig](#toolinterfaceagentconfig)
## ToolInterfaceAgent
-[Show source in tool_interface_agent.py:7](../../../../atomic_agents/agents/tool_interface_agent.py#L7)
+[Show source in tool_interface_agent.py:14](../../../../atomic_agents/agents/tool_interface_agent.py#L14)
A specialized chat agent designed to interact with a specific tool.
@@ -26,16 +27,17 @@ It generates system prompts, handles tool input and output, and can optionally r
```python
class ToolInterfaceAgent(BaseChatAgent):
- def __init__(self, tool_instance, return_raw_output=False, **kwargs): ...
+ def __init__(self, config: ToolInterfaceAgentConfig): ...
```
#### See also
- [BaseChatAgent](./base_chat_agent.md#basechatagent)
+- [ToolInterfaceAgentConfig](#toolinterfaceagentconfig)
### ToolInterfaceAgent()._get_and_handle_response
-[Show source in tool_interface_agent.py:69](../../../../atomic_agents/agents/tool_interface_agent.py#L69)
+[Show source in tool_interface_agent.py:73](../../../../atomic_agents/agents/tool_interface_agent.py#L73)
Handles obtaining and processing the response from the tool.
@@ -51,4 +53,20 @@ the raw tool output; otherwise, it processes the output and returns the response
```python
def _get_and_handle_response(self): ...
-```
\ No newline at end of file
+```
+
+
+
+## ToolInterfaceAgentConfig
+
+[Show source in tool_interface_agent.py:9](../../../../atomic_agents/agents/tool_interface_agent.py#L9)
+
+#### Signature
+
+```python
+class ToolInterfaceAgentConfig(BaseChatAgentConfig): ...
+```
+
+#### See also
+
+- [BaseChatAgentConfig](./base_chat_agent.md#basechatagentconfig)
\ No newline at end of file
diff --git a/docs/api/atomic_agents/lib/tools/index.md b/docs/api/atomic_agents/lib/tools/index.md
index 5b80c24..cee3a85 100644
--- a/docs/api/atomic_agents/lib/tools/index.md
+++ b/docs/api/atomic_agents/lib/tools/index.md
@@ -12,4 +12,5 @@
- [Base](./base.md)
- [CalculatorTool](./calculator_tool.md)
- [ContentScrapingTool](./content_scraping_tool.md)
+- [Yelp Restaurant Finder Tool](./yelp_restaurant_finder_tool.md)
- [Yt Transcript Scraper](./yt_transcript_scraper.md)
\ No newline at end of file
diff --git a/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.md b/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.md
new file mode 100644
index 0000000..a74ce80
--- /dev/null
+++ b/docs/api/atomic_agents/lib/tools/yelp_restaurant_finder_tool.md
@@ -0,0 +1,152 @@
+# Yelp Restaurant Finder Tool
+
+[Atomic_agents Index](../../../README.md#atomic_agents-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / Yelp Restaurant Finder Tool
+
+> Auto-generated documentation for [atomic_agents.lib.tools.yelp_restaurant_finder_tool](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py) module.
+
+#### Attributes
+
+- `table` - Create a table to display the results: Table(title='Yelp Search Results')
+
+
+- [Yelp Restaurant Finder Tool](#yelp-restaurant-finder-tool)
+ - [PriceRange](#pricerange)
+ - [YelpCategory](#yelpcategory)
+ - [YelpSearchResultSchema](#yelpsearchresultschema)
+ - [YelpSearchTool](#yelpsearchtool)
+ - [YelpSearchTool().run](#yelpsearchtool()run)
+ - [YelpSearchToolConfig](#yelpsearchtoolconfig)
+ - [YelpSearchToolOutputSchema](#yelpsearchtooloutputschema)
+ - [YelpSearchToolSchema](#yelpsearchtoolschema)
+
+## PriceRange
+
+[Show source in yelp_restaurant_finder_tool.py:35](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L35)
+
+#### Signature
+
+```python
+class PriceRange(Enum): ...
+```
+
+
+
+## YelpCategory
+
+[Show source in yelp_restaurant_finder_tool.py:14](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L14)
+
+#### Signature
+
+```python
+class YelpCategory(Enum): ...
+```
+
+
+
+## YelpSearchResultSchema
+
+[Show source in yelp_restaurant_finder_tool.py:61](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L61)
+
+#### Signature
+
+```python
+class YelpSearchResultSchema(BaseModel): ...
+```
+
+
+
+## YelpSearchTool
+
+[Show source in yelp_restaurant_finder_tool.py:80](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L80)
+
+Tool for performing searches using the Yelp API based on the provided queries.
+
+#### Attributes
+
+- `input_schema` *YelpSearchToolSchema* - The schema for the input data.
+- `output_schema` *YelpSearchToolOutputSchema* - The schema for the output data.
+- `api_key` *str* - The API key for the Yelp API.
+- `max_results` *int* - The maximum number of search results to return.
+
+#### Signature
+
+```python
+class YelpSearchTool(BaseTool):
+ def __init__(self, config: YelpSearchToolConfig = YelpSearchToolConfig()): ...
+```
+
+#### See also
+
+- [BaseTool](./base.md#basetool)
+- [YelpSearchToolConfig](#yelpsearchtoolconfig)
+
+### YelpSearchTool().run
+
+[Show source in yelp_restaurant_finder_tool.py:104](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L104)
+
+Runs the YelpSearchTool with the given parameters.
+
+#### Arguments
+
+- `params` *YelpSearchToolSchema* - The input parameters for the tool, adhering to the input schema.
+- `max_results` *Optional[int]* - The maximum number of search results to return.
+
+#### Returns
+
+- [YelpSearchToolOutputSchema](#yelpsearchtooloutputschema) - The output of the tool, adhering to the output schema.
+
+#### Raises
+
+- `ValueError` - If the API key is not provided.
+- `Exception` - If the request to Yelp API fails.
+
+#### Signature
+
+```python
+def run(self, params: YelpSearchToolSchema) -> YelpSearchToolOutputSchema: ...
+```
+
+#### See also
+
+- [YelpSearchToolOutputSchema](#yelpsearchtooloutputschema)
+- [YelpSearchToolSchema](#yelpsearchtoolschema)
+
+
+
+## YelpSearchToolConfig
+
+[Show source in yelp_restaurant_finder_tool.py:76](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L76)
+
+#### Signature
+
+```python
+class YelpSearchToolConfig(BaseToolConfig): ...
+```
+
+#### See also
+
+- [BaseToolConfig](./base.md#basetoolconfig)
+
+
+
+## YelpSearchToolOutputSchema
+
+[Show source in yelp_restaurant_finder_tool.py:70](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L70)
+
+#### Signature
+
+```python
+class YelpSearchToolOutputSchema(BaseModel): ...
+```
+
+
+
+## YelpSearchToolSchema
+
+[Show source in yelp_restaurant_finder_tool.py:41](../../../../../atomic_agents/lib/tools/yelp_restaurant_finder_tool.py#L41)
+
+#### Signature
+
+```python
+class YelpSearchToolSchema(BaseModel): ...
+```
\ No newline at end of file