Attach function
curl --request POST \
--url https://api.example.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach \
--header 'Content-Type: application/json' \
--header 'x-chroma-token: <api-key>' \
--data '
{
"function_id": "1e30d217-3d78-4f8c-b244-79381dc6a254",
"name": "my_function",
"output_collection": "output_collection_name",
"params": {}
}
'import requests
url = "https://api.example.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach"
payload = {
"function_id": "1e30d217-3d78-4f8c-b244-79381dc6a254",
"name": "my_function",
"output_collection": "output_collection_name",
"params": {}
}
headers = {
"x-chroma-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-chroma-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
function_id: '1e30d217-3d78-4f8c-b244-79381dc6a254',
name: 'my_function',
output_collection: 'output_collection_name',
params: {}
})
};
fetch('https://api.example.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));false{
"attached_function": {
"function_name": "<string>",
"id": "<string>",
"name": "<string>"
},
"created": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Function
Attach function
Attaches a function to a collection.
POST
/
api
/
v2
/
tenants
/
{tenant}
/
databases
/
{database}
/
collections
/
{collection_id}
/
functions
/
attach
Attach function
curl --request POST \
--url https://api.example.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach \
--header 'Content-Type: application/json' \
--header 'x-chroma-token: <api-key>' \
--data '
{
"function_id": "1e30d217-3d78-4f8c-b244-79381dc6a254",
"name": "my_function",
"output_collection": "output_collection_name",
"params": {}
}
'import requests
url = "https://api.example.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach"
payload = {
"function_id": "1e30d217-3d78-4f8c-b244-79381dc6a254",
"name": "my_function",
"output_collection": "output_collection_name",
"params": {}
}
headers = {
"x-chroma-token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-chroma-token': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
function_id: '1e30d217-3d78-4f8c-b244-79381dc6a254',
name: 'my_function',
output_collection: 'output_collection_name',
params: {}
})
};
fetch('https://api.example.com/api/v2/tenants/{tenant}/databases/{database}/collections/{collection_id}/functions/attach', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));false{
"attached_function": {
"function_name": "<string>",
"id": "<string>",
"name": "<string>"
},
"created": true
}{
"error": "<string>",
"message": "<string>"
}{
"error": "<string>",
"message": "<string>"
}Authorizations
Path Parameters
Tenant UUID
Database name
Collection UUID
Body
application/json
Function attachment request
Was this page helpful?
⌘I