API Reference
- POSTCompletion
- GETGet Prompt
- PUTUpdate Prompt
- POSTGet Model Parameters
- DELDelete Prompt
- GETList Prompts
- POSTCreate Prompt
- GETList tools
- POSTCreates tool
- GETGet Tool
- PUTUpdate tool
- DELDelete tool
- GETList Evaluation Assertions
- POSTCreate Evaluation Assertion
- GETGet Evaluation Assertion
- PUTUpdate Evaluation Assertion
- DELDelete Evaluation Assertion
- GETList Evaluations
- POSTCreate Evaluation
- GETGet Evaluation
- PUTUpdate Evaluation
- DELDelete Evaluation
Update Prompt
Update the configuration of an existing prompt and deploys it.
import PromptFoundry from '@prompt-foundry/typescript-sdk';
const client = new PromptFoundry({
apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const promptConfiguration = await client.prompts.update('1212121', {
messages: [
{
content: [
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
],
promptMessageId: 'promptMessageId',
role: 'assistant',
},
{
content: [
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
],
promptMessageId: 'promptMessageId',
role: 'assistant',
},
{
content: [
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
],
promptMessageId: 'promptMessageId',
role: 'assistant',
},
],
name: 'name',
parameters: {
frequencyPenalty: 0,
maxTokens: 0,
name: 'name',
parallelToolCalls: true,
presencePenalty: 0,
provider: 'ANTHROPIC',
responseFormat: 'JSON',
seed: 0,
stream: true,
temperature: 0,
toolChoice: 'toolChoice',
topK: 1,
topP: 0,
},
tools: [{ toolId: 'toolId' }, { toolId: 'toolId' }, { toolId: 'toolId' }],
});
console.log(promptConfiguration.id);
}
main();
{
"id": "<string>",
"name": "<string>",
"parameters": {
"provider": "ANTHROPIC",
"name": "<string>",
"responseFormat": "JSON",
"temperature": 123,
"topP": 123,
"topK": 2,
"frequencyPenalty": 123,
"presencePenalty": 123,
"maxTokens": 123,
"seed": 123,
"toolChoice": "<string>",
"stream": true,
"parallelToolCalls": true
},
"messages": [
{
"content": [
{
"type": "TEXT",
"text": "<string>"
}
],
"role": "assistant"
}
],
"tools": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {}
}
]
}
Path Parameters
"1212121"
Body
The LLM model provider.
ANTHROPIC
, OPENAI
The name of the model for the provider.
Example: PromptResponseFormat.TEXT
JSON
, TEXT
Example: 1
Example: 1
Example: 50
x >= 1
Example: 0
Example: 0
Example: 100
Example: 97946543
Response
Example: "PROMPT_1"
Example: "Check the weather"
The LLM model provider.
ANTHROPIC
, OPENAI
The name of the model for the provider.
Example: PromptResponseFormat.TEXT
JSON
, TEXT
Example: 1
Example: 1
Example: 50
x >= 1
Example: 0
Example: 0
Example: 100
Example: 97946543
The initial messages to be included with your call to the LLM API.
The name of the tool to be called. Must be a-z, A-Z, 0-9, or contain underscores and dashes, with a maximum length of 64.
A description of what the tool does, used by the model to choose when and how to call the tool.
Was this page helpful?
import PromptFoundry from '@prompt-foundry/typescript-sdk';
const client = new PromptFoundry({
apiKey: process.env['PROMPT_FOUNDRY_API_KEY'], // This is the default and can be omitted
});
async function main() {
const promptConfiguration = await client.prompts.update('1212121', {
messages: [
{
content: [
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
],
promptMessageId: 'promptMessageId',
role: 'assistant',
},
{
content: [
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
],
promptMessageId: 'promptMessageId',
role: 'assistant',
},
{
content: [
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
{ text: 'text', type: 'TEXT' },
],
promptMessageId: 'promptMessageId',
role: 'assistant',
},
],
name: 'name',
parameters: {
frequencyPenalty: 0,
maxTokens: 0,
name: 'name',
parallelToolCalls: true,
presencePenalty: 0,
provider: 'ANTHROPIC',
responseFormat: 'JSON',
seed: 0,
stream: true,
temperature: 0,
toolChoice: 'toolChoice',
topK: 1,
topP: 0,
},
tools: [{ toolId: 'toolId' }, { toolId: 'toolId' }, { toolId: 'toolId' }],
});
console.log(promptConfiguration.id);
}
main();
{
"id": "<string>",
"name": "<string>",
"parameters": {
"provider": "ANTHROPIC",
"name": "<string>",
"responseFormat": "JSON",
"temperature": 123,
"topP": 123,
"topK": 2,
"frequencyPenalty": 123,
"presencePenalty": 123,
"maxTokens": 123,
"seed": 123,
"toolChoice": "<string>",
"stream": true,
"parallelToolCalls": true
},
"messages": [
{
"content": [
{
"type": "TEXT",
"text": "<string>"
}
],
"role": "assistant"
}
],
"tools": [
{
"id": "<string>",
"name": "<string>",
"description": "<string>",
"parameters": {}
}
]
}