mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
Make agent_name optional
This commit is contained in:
@@ -22,7 +22,9 @@ class AgentExecutorBlock(Block):
|
||||
user_id: str = SchemaField(description="User ID")
|
||||
graph_id: str = SchemaField(description="Graph ID")
|
||||
graph_version: int = SchemaField(description="Graph Version")
|
||||
block_name: str = SchemaField(description="Name to display in the Builder UI")
|
||||
agent_name: Optional[str] = SchemaField(
|
||||
default=None, description="Name to display in the Builder UI"
|
||||
)
|
||||
|
||||
inputs: BlockInput = SchemaField(description="Input data for the graph")
|
||||
input_schema: dict = SchemaField(description="Input schema for the graph")
|
||||
|
||||
@@ -179,8 +179,8 @@ export default function useAgentGraph(
|
||||
setAgentDescription(graph.description);
|
||||
|
||||
const getGraphName = (node: Node) => {
|
||||
if (node.input_default.block_name) {
|
||||
return node.input_default.block_name;
|
||||
if (node.input_default.agent_name) {
|
||||
return node.input_default.agent_name;
|
||||
}
|
||||
return (
|
||||
availableFlows.find((flow) => flow.id === node.input_default.graph_id)
|
||||
@@ -296,7 +296,7 @@ export default function useAgentGraph(
|
||||
|
||||
const sinkNodeName =
|
||||
sinkNode.data.block_id === SpecialBlockID.AGENT
|
||||
? sinkNode.data.hardcodedValues?.block_name ||
|
||||
? sinkNode.data.hardcodedValues?.agent_name ||
|
||||
availableFlows.find(
|
||||
(flow) => flow.id === sinkNode.data.hardcodedValues.graph_id,
|
||||
)?.name ||
|
||||
|
||||
@@ -423,7 +423,7 @@ export const convertLibraryAgentIntoBlock = (agent: LibraryAgent) => {
|
||||
graph_version: agent.graph_version,
|
||||
input_schema: agent.input_schema,
|
||||
output_schema: agent.output_schema,
|
||||
block_name: agent.name,
|
||||
agent_name: agent.name,
|
||||
},
|
||||
} as Block;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user