Functions
Prepare a function
Start a function from an example, a plain-language task, an existing request, a short workflow or a call from your traces.
A function starts as a free draft. Open Functions and choose New function to see three tabs: Examples, Describe a task and Import. Saving a draft makes no model calls.
Start from an example
Pick a starter on the Examples tab, edit it if you like, and choose Save draft. Starters use synthetic inputs; measured results appear only after a real run.
Describe a task
Write what the function should do under What should the function do? (up to 16 KiB) and choose a Reference model. The paid preview drafts a request and output schema for you to review. Results are compared against that reference implementation.
Import a single request
Paste an OpenAI chat request on the Import tab. Supported fields are model, messages, temperature, max_tokens and response_format.
{
"model": "openai/gpt-5.4-nano",
"messages": [
{ "role": "system", "content": "Extract every person, company and position. Return JSON." },
{ "role": "user", "content": "Ada Chen is an engineer at Acme." }
],
"response_format": {
"type": "json_schema",
"json_schema": {
"name": "result",
"schema": {
"type": "object",
"properties": { "jobs": { "type": "array", "items": { "type": "object" } } },
"required": ["jobs"]
}
}
}
}Seldon treats the last user message as the variable input and every earlier message as fixed instructions. The draft records that assumption so you can confirm it in the preview.
Requirements:
- At least one user message, and up to 32 messages.
- Message content is plain text. Images, audio and other content parts are not supported.
tools,streamand other options are not supported in Functions. They still work in ordinary gateway requests.- The request is at most 256 KiB. Keep credentials out of it.
If you include a json_schema response format, it becomes the output schema. Otherwise the preview drafts one.
Import a short workflow
A workflow is up to three calls whose inputs come from your input object or from earlier calls. Declare variable fields with {{name}} placeholders and map each one to a source with bindings:
{
"inputs": {
"mentions": [{ "id": "m1", "text": "Acme Labs" }],
"catalog": [{ "id": "acme", "name": "Acme Research", "aliases": ["Acme Labs"] }]
},
"calls": [
{
"id": "link",
"model": "openai/gpt-5.4-nano",
"messages": [
{ "role": "system", "content": "Link each mention to an organization in the catalog." },
{ "role": "user", "content": "Mentions: {{mentions}}\nCatalog: {{catalog}}" }
]
}
],
"bindings": [
{ "call": "link", "message": 1, "placeholder": "{{mentions}}", "source": "input#/mentions" },
{ "call": "link", "message": 1, "placeholder": "{{catalog}}", "source": "input#/catalog" }
],
"output_schema": {
"type": "object",
"properties": { "links": { "type": "array" } },
"required": ["links"]
}
}sourceisinput#/fieldfor your input object, orcallId#/fieldfor an earlier call's output.messageis the zero-based index of the message that contains the placeholder.- Each placeholder appears exactly once in its message.
- A placeholder whose name matches exactly one input field or earlier call is bound for you. Otherwise the preview asks you to choose a source.
output_schemamust be a JSON Schema whosetypeisobjectorarray. If you omit it, the last call'sjson_schemais used.
Workflow functions are called with the input object as JSON. See Call from your app.
Select a call from your traces
Under Or select a call from traces, upload an uncompressed .json or .jsonl export of up to 10 MiB in one of these formats:
- LangSmith JSONL
- Langfuse JSONL
- Braintrust JSONL
- OpenTelemetry OTLP JSON
Choose Upload and inspect calls. Each call is marked Ready to prepare, Needs clarification (for example, when the model or max_tokens was not recorded) or Unsupported. Choose Use this call to copy one call into a new draft. Uploads are free and expire after 24 hours; copied drafts remain.
Edit a draft
The draft editor lets you change messages and the model for each call, or switch to JSON. Editing a draft after a preview invalidates that preview. Use Edit draft and invalidate the current preview, then prepare a new preview.