Compare commits

...

1 Commits

Author SHA1 Message Date
vowelparrot
25a743eb49 Include args schema 2023-04-23 19:56:18 -07:00
2 changed files with 12 additions and 2 deletions

View File

@@ -1,5 +1,6 @@
"""An agent designed to hold a conversation in addition to using tools."""
from __future__ import annotations
import json
from typing import Any, List, Optional, Sequence
@@ -69,7 +70,11 @@ class ConversationalAgent(Agent):
A PromptTemplate with the template assembled from the pieces here.
"""
tool_strings = "\n".join(
[f"> {tool.name}: {tool.description}" for tool in tools]
[
f"> {tool.name}: {tool.description},"
f" args schema: {json.dumps(tool.args)}"
for tool in tools
]
)
tool_names = ", ".join([tool.name for tool in tools])
format_instructions = format_instructions.format(

View File

@@ -1,5 +1,6 @@
"""An agent designed to hold a conversation in addition to using tools."""
from __future__ import annotations
import json
from typing import Any, List, Optional, Sequence, Tuple
@@ -65,7 +66,11 @@ class ConversationalChatAgent(Agent):
output_parser: Optional[BaseOutputParser] = None,
) -> BasePromptTemplate:
tool_strings = "\n".join(
[f"> {tool.name}: {tool.description}" for tool in tools]
[
f"> {tool.name}: {tool.description},"
f" args schema: {json.dumps(tool.args)}"
for tool in tools
]
)
tool_names = ", ".join([tool.name for tool in tools])
_output_parser = output_parser or cls._get_default_output_parser()