fix: adding info to Agent and related components (#4495)

* info added

* Update openai.py

update to Open AI model info

* info changed

* Update tool_calling.py

made info of LLM much simpler

* info updated to be simpler

* Update agent.py
This commit is contained in:
Edwin Jose 2024-11-11 22:03:44 -05:00 committed by GitHub
commit bbaec2b8da
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 26 additions and 10 deletions

View file

@ -44,18 +44,15 @@ class LCAgentComponent(Component):
display_name="Handle Parse Errors",
value=True,
advanced=True,
info="Should the Agent fix errors when reading user input for better processing?",
),
BoolInput(
name="verbose",
display_name="Verbose",
value=True,
advanced=True,
),
BoolInput(name="verbose", display_name="Verbose", value=True, advanced=True),
IntInput(
name="max_iterations",
display_name="Max Iterations",
value=15,
advanced=True,
info="The maximum number of attempts the agent can make to complete its task before it stops.",
),
MultilineInput(
name="agent_description",
@ -187,6 +184,7 @@ class LCToolsAgentComponent(LCAgentComponent):
input_types=["Tool", "BaseTool", "StructuredTool"],
is_list=True,
required=True,
info="These are the tools that the agent can use to help with tasks.",
),
*LCAgentComponent._base_inputs,
]

View file

@ -28,6 +28,7 @@ class AgentComponent(ToolCallingAgentComponent):
DropdownInput(
name="agent_llm",
display_name="Model Provider",
info="The provider of the language model that the agent will use to generate responses.",
options=[*sorted(MODEL_PROVIDERS_DICT.keys()), "Custom"],
value="OpenAI",
real_time_refresh=True,
@ -37,7 +38,7 @@ class AgentComponent(ToolCallingAgentComponent):
MultilineInput(
name="system_prompt",
display_name="Agent Instructions",
info="Initial instructions and context provided to guide the agent's behavior.",
info="System Prompt: Initial instructions and context provided to guide the agent's behavior.",
value="You are a helpful assistant that can use tools to answer questions and perform tasks.",
advanced=False,
),

View file

@ -15,14 +15,26 @@ class ToolCallingAgentComponent(LCToolsAgentComponent):
inputs = [
*LCToolsAgentComponent._base_inputs,
HandleInput(name="llm", display_name="Language Model", input_types=["LanguageModel"], required=True),
HandleInput(
name="llm",
display_name="Language Model",
input_types=["LanguageModel"],
required=True,
info="Language model that the agent utilizes to perform tasks effectively.",
),
MessageTextInput(
name="system_prompt",
display_name="System Prompt",
info="Initial instructions and context provided to guide the agent's behavior.",
value="You are a helpful assistant that can use tools to answer questions and perform tasks.",
),
DataInput(name="chat_history", display_name="Chat Memory", is_list=True, advanced=True),
DataInput(
name="chat_history",
display_name="Chat Memory",
is_list=True,
advanced=True,
info="This input stores the chat history, allowing the agent to remember previous conversations.",
),
]
def get_chat_history_data(self) -> list[Data] | None:

View file

@ -27,7 +27,12 @@ class OpenAIModelComponent(LCModelComponent):
info="The maximum number of tokens to generate. Set to 0 for unlimited tokens.",
range_spec=RangeSpec(min=0, max=128000),
),
DictInput(name="model_kwargs", display_name="Model Kwargs", advanced=True),
DictInput(
name="model_kwargs",
display_name="Model Kwargs",
advanced=True,
info="Additional keyword arguments to pass to the model.",
),
BoolInput(
name="json_mode",
display_name="JSON Mode",