Building AI agents, atomically
update API docs
KennyVaneetvelde8c9af59857cd
diff --git a/docs/api/README.md b/docs/api/README.mdindex 15950c4..83d38ab 100644--- a/docs/api/README.md+++ b/docs/api/README.md@@ -17,7 +17,8 @@ A full list of `Atomic_agents` project modules.- [Tools](atomic_agents/lib/tools/index.md#tools)- [Base](atomic_agents/lib/tools/base.md#base)- [CalculatorTool](atomic_agents/lib/tools/calculator_tool.md#calculatortool)- - [Web Scraping Tool](atomic_agents/lib/tools/web_scraping_tool.md#web-scraping-tool)+ - [ContentScrapingTool](atomic_agents/lib/tools/content_scraping_tool.md#contentscrapingtool)+ - [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)- [Logger](atomic_agents/lib/utils/logger.md#logger)diff --git a/docs/api/atomic_agents/agents/base_chat_agent.md b/docs/api/atomic_agents/agents/base_chat_agent.mdindex 82d4c00..91b78c9 100644--- a/docs/api/atomic_agents/agents/base_chat_agent.md+++ b/docs/api/atomic_agents/agents/base_chat_agent.md@@ -65,7 +65,7 @@ class BaseChatAgent:### BaseChatAgent()._get_and_handle_response-[Show source in base_chat_agent.py:134](../../../../atomic_agents/agents/base_chat_agent.py#L134)+[Show source in base_chat_agent.py:135](../../../../atomic_agents/agents/base_chat_agent.py#L135)Handles obtaining and processing the response.@@ -81,7 +81,7 @@ def _get_and_handle_response(self): ...### BaseChatAgent()._init_run-[Show source in base_chat_agent.py:151](../../../../atomic_agents/agents/base_chat_agent.py#L151)+[Show source in base_chat_agent.py:152](../../../../atomic_agents/agents/base_chat_agent.py#L152)Initializes the run with the given user input.@@ -97,7 +97,7 @@ def _init_run(self, user_input): ...### BaseChatAgent()._plan_run-[Show source in base_chat_agent.py:143](../../../../atomic_agents/agents/base_chat_agent.py#L143)+[Show source in base_chat_agent.py:144](../../../../atomic_agents/agents/base_chat_agent.py#L144)Executes the planning step, if included.@@ -109,7 +109,7 @@ def _plan_run(self): ...### BaseChatAgent()._post_run-[Show source in base_chat_agent.py:166](../../../../atomic_agents/agents/base_chat_agent.py#L166)+[Show source in base_chat_agent.py:167](../../../../atomic_agents/agents/base_chat_agent.py#L167)Finalizes the run with the given response.@@ -125,7 +125,7 @@ def _post_run(self, response): ...### BaseChatAgent()._pre_run-[Show source in base_chat_agent.py:160](../../../../atomic_agents/agents/base_chat_agent.py#L160)+[Show source in base_chat_agent.py:161](../../../../atomic_agents/agents/base_chat_agent.py#L161)Prepares for the run. This method can be overridden by subclasses to add custom pre-run logic.@@ -191,7 +191,7 @@ Runs the chat agent with the given user input.#### Arguments-- `user_input` *str* - The input text from the user.+- `user_input` *Optional[str]* - The input text from the user. If not provided, skips the initialization step.#### Returns@@ -200,7 +200,7 @@ Runs the chat agent with the given user input.#### Signature```python-def run(self, user_input: str) -> str: ...+def run(self, user_input: Optional[str] = None) -> str: ...```diff --git a/docs/api/atomic_agents/lib/components/system_prompt_generator.md b/docs/api/atomic_agents/lib/components/system_prompt_generator.mdindex 9b52a0f..6579b15 100644--- a/docs/api/atomic_agents/lib/components/system_prompt_generator.md+++ b/docs/api/atomic_agents/lib/components/system_prompt_generator.md@@ -5,15 +5,72 @@> Auto-generated documentation for [atomic_agents.lib.components.system_prompt_generator](../../../../../atomic_agents/lib/components/system_prompt_generator.py) module.- [SystemPromptGenerator](#systempromptgenerator)- - [SystemPromptContextProviderBase](#SystemPromptContextproviderbase)- - [SystemPromptContextProviderBase().get_info](#SystemPromptContextproviderbase()get_info)+ - [CurrentDateProvider](#currentdateprovider)+ - [CurrentDateProvider().get_info](#currentdateprovider()get_info)+ - [LoremIpsumProvider](#loremipsumprovider)+ - [LoremIpsumProvider().get_info](#loremipsumprovider()get_info)+ - [SystemPromptContextProviderBase](#systempromptcontextproviderbase)+ - [SystemPromptContextProviderBase().get_info](#systempromptcontextproviderbase()get_info)- [SystemPromptGenerator](#systempromptgenerator-1)- [SystemPromptGenerator().generate_prompt](#systempromptgenerator()generate_prompt)- [SystemPromptInfo](#systempromptinfo)+## CurrentDateProvider++[Show source in system_prompt_generator.py:56](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L56)++#### Signature++```python+class CurrentDateProvider(SystemPromptContextProviderBase):+ def __init__(self, format: str = "%Y-%m-%d %H:%M:%S", **kwargs): ...+```++#### See also++- [SystemPromptContextProviderBase](#systempromptcontextproviderbase)++### CurrentDateProvider().get_info++[Show source in system_prompt_generator.py:61](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L61)++#### Signature++```python+def get_info(self) -> str: ...+```++++## LoremIpsumProvider++[Show source in system_prompt_generator.py:64](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L64)++#### Signature++```python+class LoremIpsumProvider(SystemPromptContextProviderBase): ...+```++#### See also++- [SystemPromptContextProviderBase](#systempromptcontextproviderbase)++### LoremIpsumProvider().get_info++[Show source in system_prompt_generator.py:65](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L65)++#### Signature++```python+def get_info(self) -> str: ...+```+++## SystemPromptContextProviderBase-[Show source in system_prompt_generator.py:10](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L10)+[Show source in system_prompt_generator.py:6](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L6)#### Signature@@ -24,7 +81,7 @@ class SystemPromptContextProviderBase(ABC):### SystemPromptContextProviderBase().get_info-[Show source in system_prompt_generator.py:14](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L14)+[Show source in system_prompt_generator.py:10](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L10)#### Signature@@ -37,27 +94,22 @@ def get_info(self) -> str: ...## SystemPromptGenerator-[Show source in system_prompt_generator.py:18](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L18)+[Show source in system_prompt_generator.py:21](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L21)#### Signature```pythonclass SystemPromptGenerator:- def __init__(- self,- system_prompt_info: SystemPromptInfo = None,- system_prompt_context_providers: dict[str, SystemPromptContextProviderBase] = None,- ): ...+ def __init__(self, system_prompt_info: SystemPromptInfo = None): ...```#### See also-- [SystemPromptContextProviderBase](#SystemPromptContextproviderbase)- [SystemPromptInfo](#systempromptinfo)### SystemPromptGenerator().generate_prompt-[Show source in system_prompt_generator.py:27](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L27)+[Show source in system_prompt_generator.py:30](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L30)#### Signature@@ -69,10 +121,10 @@ def generate_prompt(self) -> str: ...## SystemPromptInfo-[Show source in system_prompt_generator.py:5](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L5)+[Show source in system_prompt_generator.py:15](../../../../../atomic_agents/lib/components/system_prompt_generator.py#L15)#### Signature```python-class SystemPromptInfo(BaseModel): ...+class SystemPromptInfo: ...```\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/base.md b/docs/api/atomic_agents/lib/tools/base.mdindex 202eb41..cf55d09 100644--- a/docs/api/atomic_agents/lib/tools/base.md+++ b/docs/api/atomic_agents/lib/tools/base.md@@ -7,10 +7,11 @@- [Base](#base)- [BaseTool](#basetool)- [BaseTool().run](#basetool()run)+ - [BaseToolConfig](#basetoolconfig)## BaseTool-[Show source in base.py:4](../../../../../atomic_agents/lib/tools/base.py#L4)+[Show source in base.py:9](../../../../../atomic_agents/lib/tools/base.py#L9)Base class for all tools in the Atomic Agents framework.@@ -25,12 +26,16 @@ Base class for all tools in the Atomic Agents framework.```pythonclass BaseTool:- def __init__(self, tool_description_override: Optional[str] = None): ...+ def __init__(self, config: BaseToolConfig = BaseToolConfig()): ...```+#### See also++- [BaseToolConfig](#basetoolconfig)+### BaseTool().run-[Show source in base.py:28](../../../../../atomic_agents/lib/tools/base.py#L28)+[Show source in base.py:33](../../../../../atomic_agents/lib/tools/base.py#L33)Runs the tool with the given parameters. This method should be implemented by subclasses.@@ -49,5 +54,17 @@ Runs the tool with the given parameters. This method should be implemented by su#### Signature```python-def run(self, params: BaseModel) -> BaseModel: ...+def run(self, params: Type[BaseModel]) -> BaseModel: ...+```++++## BaseToolConfig++[Show source in base.py:5](../../../../../atomic_agents/lib/tools/base.py#L5)++#### Signature++```python+class BaseToolConfig(BaseModel): ...```\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/calculator_tool.md b/docs/api/atomic_agents/lib/tools/calculator_tool.mdindex c561eea..f86a52b 100644--- a/docs/api/atomic_agents/lib/tools/calculator_tool.md+++ b/docs/api/atomic_agents/lib/tools/calculator_tool.md@@ -4,22 +4,16 @@> Auto-generated documentation for [atomic_agents.lib.tools.calculator_tool](../../../../../atomic_agents/lib/tools/calculator_tool.py) module.-#### Attributes--- `client` - Initialize the client outside: instructor.from_openai(openai.OpenAI(api_key=os.getenv('OPENAI_API_KEY'), base_url=os.getenv('OPENAI_BASE_URL')))--- `result` - Extract structured data from natural language: client.chat.completions.create(model='gpt-3.5-turbo', response_model=CalculatorTool.input_schema, messages=[{'role': 'user', 'content': 'Calculate 2 + 2'}])--- [CalculatorTool](#calculatortool)- [CalculatorTool](#calculatortool-1)- [CalculatorTool().run](#calculatortool()run)+ - [CalculatorToolConfig](#calculatortoolconfig)- [CalculatorToolOutputSchema](#calculatortooloutputschema)- [CalculatorToolSchema](#calculatortoolschema)## CalculatorTool-[Show source in calculator_tool.py:32](../../../../../atomic_agents/lib/tools/calculator_tool.py#L32)+[Show source in calculator_tool.py:35](../../../../../atomic_agents/lib/tools/calculator_tool.py#L35)Tool for performing calculations based on the provided mathematical expression.@@ -32,16 +26,17 @@ Tool for performing calculations based on the provided mathematical expression.```pythonclass CalculatorTool(BaseTool):- def __init__(self, **kwargs): ...+ def __init__(self, config: CalculatorToolConfig = CalculatorToolConfig()): ...```#### See also- [BaseTool](./base.md#basetool)+- [CalculatorToolConfig](#calculatortoolconfig)### CalculatorTool().run-[Show source in calculator_tool.py:53](../../../../../atomic_agents/lib/tools/calculator_tool.py#L53)+[Show source in calculator_tool.py:55](../../../../../atomic_agents/lib/tools/calculator_tool.py#L55)Runs the CalculatorTool with the given parameters.@@ -70,6 +65,22 @@ def run(self, params: CalculatorToolSchema) -> CalculatorToolOutputSchema: ...+## CalculatorToolConfig++[Show source in calculator_tool.py:32](../../../../../atomic_agents/lib/tools/calculator_tool.py#L32)++#### Signature++```python+class CalculatorToolConfig(BaseToolConfig): ...+```++#### See also++- [BaseToolConfig](./base.md#basetoolconfig)+++## CalculatorToolOutputSchema[Show source in calculator_tool.py:26](../../../../../atomic_agents/lib/tools/calculator_tool.py#L26)diff --git a/docs/api/atomic_agents/lib/tools/content_scraping_tool.md b/docs/api/atomic_agents/lib/tools/content_scraping_tool.mdnew file mode 100644index 0000000..dbe679b--- /dev/null+++ b/docs/api/atomic_agents/lib/tools/content_scraping_tool.md@@ -0,0 +1,126 @@+# ContentScrapingTool++[Atomic_agents Index](../../../README.md#atomic_agents-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / ContentScrapingTool++> Auto-generated documentation for [atomic_agents.lib.tools.content_scraping_tool](../../../../../atomic_agents/lib/tools/content_scraping_tool.py) module.++#### Attributes++- `result` - ################+ TEST WEB PAGE #+ ################: client.chat.completions.create(model='gpt-3.5-turbo', response_model=ContentScrapingTool.input_schema, messages=[{'role': 'user', 'content': 'Scrape the content of https://example.com'}])++- `result` - ###############+ TEST PDF URL #+ ###############: client.chat.completions.create(model='gpt-3.5-turbo', response_model=ContentScrapingTool.input_schema, messages=[{'role': 'user', 'content': 'Scrape the content of https://pdfobject.com/pdf/sample.pdf'}])+++- [ContentScrapingTool](#contentscrapingtool)+ - [ContentScrapingResultSchema](#contentscrapingresultschema)+ - [ContentScrapingTool](#contentscrapingtool-1)+ - [ContentScrapingTool().run](#contentscrapingtool()run)+ - [ContentScrapingToolConfig](#contentscrapingtoolconfig)+ - [ContentScrapingToolOutputSchema](#contentscrapingtooloutputschema)+ - [ContentScrapingToolSchema](#contentscrapingtoolschema)++## ContentScrapingResultSchema++[Show source in content_scraping_tool.py:30](../../../../../atomic_agents/lib/tools/content_scraping_tool.py#L30)++#### Signature++```python+class ContentScrapingResultSchema(BaseModel): ...+```++++## ContentScrapingTool++[Show source in content_scraping_tool.py:43](../../../../../atomic_agents/lib/tools/content_scraping_tool.py#L43)++Tool for scraping web pages or PDFs and converting content to markdown.++#### Attributes++- `input_schema` *ContentScrapingToolSchema* - The schema for the input data.+- `output_schema` *ContentScrapingToolOutputSchema* - The schema for the output data.++#### Signature++```python+class ContentScrapingTool(BaseTool):+ def __init__(+ self, config: ContentScrapingToolConfig = ContentScrapingToolConfig()+ ): ...+```++#### See also++- [BaseTool](./base.md#basetool)+- [ContentScrapingToolConfig](#contentscrapingtoolconfig)++### ContentScrapingTool().run++[Show source in content_scraping_tool.py:63](../../../../../atomic_agents/lib/tools/content_scraping_tool.py#L63)++Runs the ContentScrapingTool with the given parameters.++#### Arguments++- `params` *ContentScrapingToolSchema* - The input parameters for the tool, adhering to the input schema.++#### Returns++- [ContentScrapingToolOutputSchema](#contentscrapingtooloutputschema) - The output of the tool, adhering to the output schema.++#### Signature++```python+def run(self, params: ContentScrapingToolSchema) -> ContentScrapingToolOutputSchema: ...+```++#### See also++- [ContentScrapingToolOutputSchema](#contentscrapingtooloutputschema)+- [ContentScrapingToolSchema](#contentscrapingtoolschema)++++## ContentScrapingToolConfig++[Show source in content_scraping_tool.py:40](../../../../../atomic_agents/lib/tools/content_scraping_tool.py#L40)++#### Signature++```python+class ContentScrapingToolConfig(BaseToolConfig): ...+```++#### See also++- [BaseToolConfig](./base.md#basetoolconfig)++++## ContentScrapingToolOutputSchema++[Show source in content_scraping_tool.py:34](../../../../../atomic_agents/lib/tools/content_scraping_tool.py#L34)++#### Signature++```python+class ContentScrapingToolOutputSchema(BaseModel): ...+```++++## ContentScrapingToolSchema++[Show source in content_scraping_tool.py:16](../../../../../atomic_agents/lib/tools/content_scraping_tool.py#L16)++#### Signature++```python+class ContentScrapingToolSchema(BaseModel): ...+```\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/index.md b/docs/api/atomic_agents/lib/tools/index.mdindex 834a149..5b80c24 100644--- a/docs/api/atomic_agents/lib/tools/index.md+++ b/docs/api/atomic_agents/lib/tools/index.md@@ -11,4 +11,5 @@- [Base](./base.md)- [CalculatorTool](./calculator_tool.md)-- [Web Scraping Tool](./web_scraping_tool.md)\ No newline at end of file+- [ContentScrapingTool](./content_scraping_tool.md)+- [Yt Transcript Scraper](./yt_transcript_scraper.md)\ No newline at end of filediff --git a/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.md b/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.mdnew file mode 100644index 0000000..3b7e72b--- /dev/null+++ b/docs/api/atomic_agents/lib/tools/yt_transcript_scraper.md@@ -0,0 +1,162 @@+# Yt Transcript Scraper++[Atomic_agents Index](../../../README.md#atomic_agents-index) / [Atomic Agents](../../index.md#atomic-agents) / [Lib](../index.md#lib) / [Tools](./index.md#tools) / Yt Transcript Scraper++> Auto-generated documentation for [atomic_agents.lib.tools.yt_transcript_scraper](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py) module.++- [Yt Transcript Scraper](#yt-transcript-scraper)+ - [YouTubeTranscriptResultSchema](#youtubetranscriptresultschema)+ - [YouTubeTranscriptTool](#youtubetranscripttool)+ - [YouTubeTranscriptTool.extract_video_id](#youtubetranscripttoolextract_video_id)+ - [YouTubeTranscriptTool().fetch_video_metadata](#youtubetranscripttool()fetch_video_metadata)+ - [YouTubeTranscriptTool().run](#youtubetranscripttool()run)+ - [YouTubeTranscriptToolConfig](#youtubetranscripttoolconfig)+ - [YouTubeTranscriptToolOutputSchema](#youtubetranscripttooloutputschema)+ - [YouTubeTranscriptToolSchema](#youtubetranscripttoolschema)++## YouTubeTranscriptResultSchema++[Show source in yt_transcript_scraper.py:27](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L27)++#### Signature++```python+class YouTubeTranscriptResultSchema(BaseModel): ...+```++++## YouTubeTranscriptTool++[Show source in yt_transcript_scraper.py:44](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L44)++Tool for fetching the transcript of a YouTube video using the YouTube Transcript API.++#### Attributes++- `input_schema` *YouTubeTranscriptToolSchema* - The schema for the input data.+- `output_schema` *YouTubeTranscriptToolOutputSchema* - The schema for the output data.++#### Signature++```python+class YouTubeTranscriptTool(BaseTool):+ def __init__(self, config: YouTubeTranscriptToolConfig): ...+```++#### See also++- [BaseTool](./base.md#basetool)+- [YouTubeTranscriptToolConfig](#youtubetranscripttoolconfig)++### YouTubeTranscriptTool.extract_video_id++[Show source in yt_transcript_scraper.py:99](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L99)++Extracts the video ID from a YouTube URL.++#### Arguments++- `url` *str* - The YouTube video URL.++#### Returns++- `str` - The extracted video ID.++#### Signature++```python+@staticmethod+def extract_video_id(url: str) -> str: ...+```++### YouTubeTranscriptTool().fetch_video_metadata++[Show source in yt_transcript_scraper.py:112](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L112)++Fetches metadata for a YouTube video.++#### Arguments++- `video_id` *str* - The YouTube video ID.++#### Returns++- `dict` - The metadata of the video.++#### Signature++```python+def fetch_video_metadata(self, video_id: str) -> dict: ...+```++### YouTubeTranscriptTool().run++[Show source in yt_transcript_scraper.py:65](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L65)++Runs the YouTubeTranscriptTool with the given parameters.++#### Arguments++- `params` *YouTubeTranscriptToolSchema* - The input parameters for the tool, adhering to the input schema.++#### Returns++- [YouTubeTranscriptToolOutputSchema](#youtubetranscripttooloutputschema) - The output of the tool, adhering to the output schema.++#### Raises++- `Exception` - If fetching the transcript fails.++#### Signature++```python+def run(+ self, params: YouTubeTranscriptToolSchema+) -> YouTubeTranscriptToolOutputSchema: ...+```++#### See also++- [YouTubeTranscriptToolOutputSchema](#youtubetranscripttooloutputschema)+- [YouTubeTranscriptToolSchema](#youtubetranscripttoolschema)++++## YouTubeTranscriptToolConfig++[Show source in yt_transcript_scraper.py:41](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L41)++#### Signature++```python+class YouTubeTranscriptToolConfig(BaseToolConfig): ...+```++#### See also++- [BaseToolConfig](./base.md#basetoolconfig)++++## YouTubeTranscriptToolOutputSchema++[Show source in yt_transcript_scraper.py:32](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L32)++#### Signature++```python+class YouTubeTranscriptToolOutputSchema(BaseModel): ...+```++++## YouTubeTranscriptToolSchema++[Show source in yt_transcript_scraper.py:12](../../../../../atomic_agents/lib/tools/yt_transcript_scraper.py#L12)++#### Signature++```python+class YouTubeTranscriptToolSchema(BaseModel): ...+```\ No newline at end of file