API Reference
Platform APIs
- Models
- Functions
- Observability
- Knowledge base
- Datasets
- Other
Functions
Get Function By Revision
Get a function by ID with a specific revision
GET
/
functions
/
{function_id}
/
revisions
/
{revision_id}
Copy
Ask AI
import requests
url = "https://api.opper.ai/v2/functions/{function_id}/revisions/{revision_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
Copy
Ask AI
{
"name": "my-function",
"description": "This function is used to add two numbers and return the result.",
"instructions": "You are a calculator that adds two numbers and returns the result.",
"input_schema": {
"properties": {
"x": {
"title": "X",
"type": "integer"
},
"y": {
"title": "Y",
"type": "integer"
}
},
"required": [
"x",
"y"
],
"title": "OpperInputExample",
"type": "object"
},
"output_schema": {
"properties": {
"sum": {
"title": "Sum",
"type": "integer"
}
},
"required": [
"sum"
],
"title": "OpperOutputExample",
"type": "object"
},
"model": {
"extra_headers": {},
"name": "openai/gpt-4o-mini",
"options": {
"temperature": 0.5
}
},
"configuration": {
"beta.evaluation.enabled": true,
"invocation.cache.ttl": 0,
"invocation.few_shot.count": 0,
"invocation.structured_generation.max_attempts": 5
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
Authorizations
Bearer authentication header of the form Bearer <token>
, where <token>
is your auth token.
Path Parameters
The id of the function to retrieve
The id of the revision to retrieve
Response
200
application/json
Successful Response
The response is of type object
.
Copy
Ask AI
import requests
url = "https://api.opper.ai/v2/functions/{function_id}/revisions/{revision_id}"
headers = {"Authorization": "Bearer <token>"}
response = requests.request("GET", url, headers=headers)
print(response.text)
Copy
Ask AI
{
"name": "my-function",
"description": "This function is used to add two numbers and return the result.",
"instructions": "You are a calculator that adds two numbers and returns the result.",
"input_schema": {
"properties": {
"x": {
"title": "X",
"type": "integer"
},
"y": {
"title": "Y",
"type": "integer"
}
},
"required": [
"x",
"y"
],
"title": "OpperInputExample",
"type": "object"
},
"output_schema": {
"properties": {
"sum": {
"title": "Sum",
"type": "integer"
}
},
"required": [
"sum"
],
"title": "OpperOutputExample",
"type": "object"
},
"model": {
"extra_headers": {},
"name": "openai/gpt-4o-mini",
"options": {
"temperature": 0.5
}
},
"configuration": {
"beta.evaluation.enabled": true,
"invocation.cache.ttl": 0,
"invocation.few_shot.count": 0,
"invocation.structured_generation.max_attempts": 5
},
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"dataset_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"revision_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
Assistant
Responses are generated using AI and may contain mistakes.