Skip to main content

Integrate Tools to Assistants

Creating an Assistant with Integrated Tools

To integrate the tools into an assistant, use the create_assistant method and include the tools in the tools parameter. Each tool should be represented by a AssistantTool object, which includes the type and id of the tool.

You should pass one of the AssistantToolType.ACTION and AssistantToolType.PLUGIN to the type parameter.

from taskingai.assistant import Assistant, AssistantTool, AssistantToolType

assistant: Assistant = taskingai.assistant.create_assistant(
model_id="YOUR_MODEL_ID",
memory={"type": "naive"},
tools=[
AssistantTool(
type=AssistantToolType.ACTION,
id="YOUR_ACTION_ID"),
AssistantTool(
type=AssistantToolType.PLUGIN,
id="YOUR_PLUGIN_ID"),
]
)

Update Assistant with Integrated Tools

Similarly, we can also integrate tools to existing assistant by using the update_assistant method.

from taskingai.assistant import Assistant, AssistantTool, AssistantToolType

assistant: Assistant = taskingai.assistant.update_assistant(
assistant_id="YOUR_ASSISTANT_ID",
tools=[
AssistantTool(
type=AssistantToolType.ACTION,
id="YOUR_ACTION_ID"),
AssistantTool(
type=AssistantToolType.PLUGIN,
id="YOUR_PLUGIN_ID"),
]
)