@@ -23,11 +23,10 @@ class Agent(AbstractApiClass):
23
23
agentExecutionConfig (dict): The config for arguments used to execute the agent.
24
24
latestAgentVersion (AgentVersion): The latest agent version.
25
25
codeSource (CodeSource): If a python model, information on the source code
26
- draftWorkflowGraph (WorkflowGraph): The last saved draft of workflow graph for the agent.
27
26
workflowGraph (WorkflowGraph): The workflow graph for the agent.
28
27
"""
29
28
30
- def __init__ (self , client , name = None , agentId = None , createdAt = None , projectId = None , notebookId = None , predictFunctionName = None , sourceCode = None , agentConfig = None , memory = None , trainingRequired = None , agentExecutionConfig = None , codeSource = {}, latestAgentVersion = {}, draftWorkflowGraph = {}, workflowGraph = {}):
29
+ def __init__ (self , client , name = None , agentId = None , createdAt = None , projectId = None , notebookId = None , predictFunctionName = None , sourceCode = None , agentConfig = None , memory = None , trainingRequired = None , agentExecutionConfig = None , codeSource = {}, latestAgentVersion = {}, workflowGraph = {}):
31
30
super ().__init__ (client , agentId )
32
31
self .name = name
33
32
self .agent_id = agentId
@@ -43,14 +42,12 @@ def __init__(self, client, name=None, agentId=None, createdAt=None, projectId=No
43
42
self .code_source = client ._build_class (CodeSource , codeSource )
44
43
self .latest_agent_version = client ._build_class (
45
44
AgentVersion , latestAgentVersion )
46
- self .draft_workflow_graph = client ._build_class (
47
- WorkflowGraph , draftWorkflowGraph )
48
45
self .workflow_graph = client ._build_class (WorkflowGraph , workflowGraph )
49
46
self .deprecated_keys = {}
50
47
51
48
def __repr__ (self ):
52
- repr_dict = {f'name' : repr (self .name ), f'agent_id' : repr (self .agent_id ), f'created_at' : repr (self .created_at ), f'project_id' : repr (self .project_id ), f'notebook_id' : repr (self .notebook_id ), f'predict_function_name' : repr (self .predict_function_name ), f'source_code' : repr (self .source_code ), f'agent_config' : repr (self . agent_config ), f'memory' : repr (
53
- self .memory ), f'training_required ' : repr (self .training_required ), f'agent_execution_config ' : repr (self .agent_execution_config ), f'code_source ' : repr (self .code_source ), f'latest_agent_version ' : repr (self .latest_agent_version ), f'draft_workflow_graph ' : repr (self .draft_workflow_graph ), f'workflow_graph' : repr (self .workflow_graph )}
49
+ repr_dict = {f'name' : repr (self .name ), f'agent_id' : repr (self .agent_id ), f'created_at' : repr (self .created_at ), f'project_id' : repr (self .project_id ), f'notebook_id' : repr (self .notebook_id ), f'predict_function_name' : repr (self .predict_function_name ), f'source_code' : repr (self .source_code ), f'agent_config' : repr (
50
+ self .agent_config ), f'memory ' : repr (self .memory ), f'training_required ' : repr (self .training_required ), f'agent_execution_config ' : repr (self .agent_execution_config ), f'code_source ' : repr (self .code_source ), f'latest_agent_version ' : repr (self .latest_agent_version ), f'workflow_graph' : repr (self .workflow_graph )}
54
51
class_name = "Agent"
55
52
repr_str = ',\n ' .join ([f'{ key } ={ value } ' for key , value in repr_dict .items (
56
53
) if getattr (self , key , None ) is not None and key not in self .deprecated_keys ])
@@ -63,8 +60,8 @@ def to_dict(self):
63
60
Returns:
64
61
dict: The dict value representation of the class parameters
65
62
"""
66
- resp = {'name' : self .name , 'agent_id' : self .agent_id , 'created_at' : self .created_at , 'project_id' : self .project_id , 'notebook_id' : self .notebook_id , 'predict_function_name' : self .predict_function_name , 'source_code' : self .source_code , 'agent_config' : self .agent_config , 'memory' : self .memory , 'training_required' : self . training_required ,
67
- 'agent_execution_config ' : self .agent_execution_config , 'code_source ' : self ._get_attribute_as_dict ( self . code_source ) , 'latest_agent_version ' : self ._get_attribute_as_dict (self .latest_agent_version ), 'draft_workflow_graph ' : self ._get_attribute_as_dict (self .draft_workflow_graph ), 'workflow_graph' : self ._get_attribute_as_dict (self .workflow_graph )}
63
+ resp = {'name' : self .name , 'agent_id' : self .agent_id , 'created_at' : self .created_at , 'project_id' : self .project_id , 'notebook_id' : self .notebook_id , 'predict_function_name' : self .predict_function_name , 'source_code' : self .source_code , 'agent_config' : self .agent_config , 'memory' : self .memory ,
64
+ 'training_required ' : self .training_required , 'agent_execution_config ' : self .agent_execution_config , 'code_source ' : self ._get_attribute_as_dict (self .code_source ), 'latest_agent_version ' : self ._get_attribute_as_dict (self .latest_agent_version ), 'workflow_graph' : self ._get_attribute_as_dict (self .workflow_graph )}
68
65
return {key : value for key , value in resp .items () if value is not None and key not in self .deprecated_keys }
69
66
70
67
def refresh (self ):
0 commit comments