Skip to content

Commit a935f81

Browse files
updated the operation for updating an agent
1 parent b319504 commit a935f81

File tree

2 files changed

+20
-11
lines changed

2 files changed

+20
-11
lines changed

mindsdb_sdk/agents.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -582,6 +582,9 @@ def update(self, name: str, updated_agent: Agent):
582582
updated_agent.model_name,
583583
list(skills_to_add),
584584
list(skills_to_remove),
585+
updated_agent.data,
586+
updated_agent.model,
587+
updated_agent.prompt_template,
585588
updated_agent.params
586589
)
587590
return Agent.from_json(data, self)

mindsdb_sdk/connectors/rest_api.py

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -339,26 +339,32 @@ def create_agent(
339339

340340
@_try_relogin
341341
def update_agent(
342-
self,
343-
project: str,
344-
name: str,
345-
updated_name: str,
346-
updated_provider: str,
347-
updated_model: str,
348-
skills_to_add: List[str],
349-
skills_to_remove: List[str],
350-
updated_params: dict
351-
):
342+
self,
343+
project: str,
344+
name: str,
345+
updated_name: str,
346+
updated_provider: str,
347+
updated_model_name: str,
348+
skills_to_add: List[str],
349+
skills_to_remove: List[str],
350+
updated_data: dict,
351+
updated_model: dict,
352+
updated_prompt_template: str,
353+
updated_params: dict
354+
):
352355
url = self.url + f'/api/projects/{project}/agents/{name}'
353356
r = self.session.put(
354357
url,
355358
json={
356359
'agent': {
357360
'name': updated_name,
358-
'model_name': updated_model,
361+
'model_name': updated_model_name,
359362
'provider': updated_provider,
360363
'skills_to_add': skills_to_add,
361364
'skills_to_remove': skills_to_remove,
365+
'data': updated_data,
366+
'model': updated_model,
367+
'prompt_template': updated_prompt_template,
362368
'params': updated_params
363369
}
364370
}

0 commit comments

Comments
 (0)