diff --git a/docs/pydoc/config/agent.yml b/docs/pydoc/config/agent.yml index 8f626f732..80cd833e7 100644 --- a/docs/pydoc/config/agent.yml +++ b/docs/pydoc/config/agent.yml @@ -6,6 +6,8 @@ loaders: processors: - type: filter expression: "name not in ['print_text']" + - type: filter + expression: documented_only: true do_not_filter_modules: false skip_empty_modules: true diff --git a/haystack/agents/conversational.py b/haystack/agents/conversational.py index 230d44678..5701661be 100644 --- a/haystack/agents/conversational.py +++ b/haystack/agents/conversational.py @@ -17,14 +17,15 @@ class ConversationalAgent(Agent): If no tools are provided, the agent will be initialized to have a basic chat application. Here is an example how you can create a chat application with tools: + ```python import os from haystack.agents.conversational import ConversationalAgent from haystack.nodes import PromptNode - from haystack.agents.base import ToolsManager, Tool + from haystack.agents.base import Tool - # Initialize a PromptNode and a ToolsManager with the desired tools + # Initialize a PromptNode and the desired tools prompt_node = PromptNode("gpt-3.5-turbo", api_key=os.environ.get("OPENAI_API_KEY"), max_length=256) tools = [Tool(name="ExampleTool", pipeline_or_node=example_tool_node)] @@ -38,10 +39,11 @@ class ConversationalAgent(Agent): break else: assistant_response = agent.run(user_input) - print("\nAssistant:", assistant_response) + print("Assistant:", assistant_response) ``` If you don't want to have any tools in your chat app, you can create a ConversationalAgent only with a PromptNode: + ```python import os