PUT
/
sdk
/
v1
/
prompts
/
{id}
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

id
string
required
Example:

"1212121"

Body

application/json
name
string
required
tools
object[]
required
messages
object[]
required
parameters
object
required

Response

200
application/json
Successful operation
id
string
required

Example: "PROMPT_1"

name
string
required

Example: "Check the weather"

parameters
object
required
messages
object[]
required

The configured messages WITHOUT variables replaced.

tools
object[]
required