Tools
Custom Tools
How to create custom tools with Danswer
First, navigate to the Admin console, and go to the Tools tab. Click the New Tool button.
Next, specify a OpenAPI 3.0 or OpenAPI 3.1 schema that defines the APIs that you want to make available as part of this tool.
To improve performance:
- Add descriptive
summary
s for each operation (API). - Give each operation a descriptive
operationId
. - Add
description
s for parameter.
For example, you could use the following to create a tool that allows an assistant to fetch and create assistants with Danswer:
{
"openapi":"3.0.0",
"info":{
"version":"1.0.0",
"title":"Assistants API",
"description":"An API for managing assistants within Danswer"
},
"servers":[
{
"url":"http://localhost:8080"
}
],
"paths":{
"/persona":{
"get":{
"summary":"Get a specific Assistant",
"operationId":"getAssistant",
"parameters":[
{
"name":"assistant_id",
"in":"path",
"required":true,
"schema":{
"type":"string"
}
}
]
},
"post":{
"summary":"Create a new Assistant",
"operationId":"createAssistant",
"requestBody":{
"required":true,
"content":{
"application/json":{
"schema":{
"type":"object",
"properties":{
"name":{
"type":"string"
},
"description":{
"type":"string"
},
"num_chunks":{
"type":"number"
},
"llm_relevance_filter":{
"type":"boolean"
},
"is_public":{
"type":"boolean"
},
"llm_filter_extraction":{
"type":"boolean"
},
"recency_bias":{
"type":"string",
"enum":[
"favor_recent",
"base_decay",
"no_decay",
"auto"
]
},
"prompt_ids":{
"type":"array",
"items":{
"type":"integer"
}
},
"document_set_ids":{
"type":"array",
"items":{
"type":"integer"
}
},
"tool_ids":{
"type":"array",
"items":{
"type":"integer"
}
},
"llm_model_provider_override":{
"type":"string",
"nullable":true
},
"llm_model_version_override":{
"type":"string",
"nullable":true
},
"starter_messages":{
"type":"array",
"items":{
"type":"object",
"properties":{
"role":{
"type":"string"
},
"content":{
"type":"string"
}
}
},
"nullable":true
},
"users":{
"type":"array",
"items":{
"type":"string",
"format":"uuid"
},
"nullable":true
},
"groups":{
"type":"array",
"items":{
"type":"integer"
},
"nullable":true
}
},
"required":[
"name",
"description",
"num_chunks",
"llm_relevance_filter",
"is_public",
"llm_filter_extraction",
"recency_bias",
"prompt_ids",
"document_set_ids",
"tool_ids"
]
}
}
}
}
}
}
}
}