Join our webinar: Building Reliable Conversational & Voice AI with Simulations, this Thursday, November 13th. Link
import requests
url = "https://app.langwatch.ai/api/prompts"
payload = {
"handle": "<string>",
"scope": "PROJECT",
"model": "<string>",
"temperature": 123,
"maxTokens": 123,
"commitMessage": "<string>",
"authorId": "<string>",
"prompt": "<string>",
"messages": [
{
"role": "user",
"content": "<string>"
}
],
"inputs": [
{
"identifier": "<string>",
"type": "str"
}
],
"outputs": [
{
"identifier": "<string>",
"type": "str",
"json_schema": { "type": "<string>" }
}
],
"schemaVersion": "1.0"
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"handle": "<string>",
"scope": "ORGANIZATION",
"name": "<string>",
"updatedAt": "<string>",
"projectId": "<string>",
"organizationId": "<string>",
"versionId": "<string>",
"version": 123,
"createdAt": "<string>",
"prompt": "<string>",
"messages": [],
"inputs": [
{
"identifier": "<string>",
"type": "str"
}
],
"outputs": [
{
"identifier": "<string>",
"type": "str",
"json_schema": {
"type": "<string>"
}
}
],
"model": "<string>",
"authorId": "<string>",
"commitMessage": "<string>",
"temperature": 123,
"maxTokens": 123,
"demonstrations": {
"id": "<string>",
"name": "<string>",
"inline": {
"records": {},
"columnTypes": [
{
"name": "<string>",
"type": "<string>",
"id": "<string>"
}
]
}
},
"promptingTechnique": {
"type": "few_shot",
"demonstrations": {
"id": "<string>",
"name": "<string>",
"inline": {
"records": {},
"columnTypes": [
{
"name": "<string>",
"type": "<string>",
"id": "<string>"
}
]
}
}
},
"responseFormat": {
"type": "json_schema",
"json_schema": {
"name": "<string>",
"schema": {}
}
}
}Create a new prompt with default initial version
import requests
url = "https://app.langwatch.ai/api/prompts"
payload = {
"handle": "<string>",
"scope": "PROJECT",
"model": "<string>",
"temperature": 123,
"maxTokens": 123,
"commitMessage": "<string>",
"authorId": "<string>",
"prompt": "<string>",
"messages": [
{
"role": "user",
"content": "<string>"
}
],
"inputs": [
{
"identifier": "<string>",
"type": "str"
}
],
"outputs": [
{
"identifier": "<string>",
"type": "str",
"json_schema": { "type": "<string>" }
}
],
"schemaVersion": "1.0"
}
headers = {
"X-Auth-Token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"id": "<string>",
"handle": "<string>",
"scope": "ORGANIZATION",
"name": "<string>",
"updatedAt": "<string>",
"projectId": "<string>",
"organizationId": "<string>",
"versionId": "<string>",
"version": 123,
"createdAt": "<string>",
"prompt": "<string>",
"messages": [],
"inputs": [
{
"identifier": "<string>",
"type": "str"
}
],
"outputs": [
{
"identifier": "<string>",
"type": "str",
"json_schema": {
"type": "<string>"
}
}
],
"model": "<string>",
"authorId": "<string>",
"commitMessage": "<string>",
"temperature": 123,
"maxTokens": 123,
"demonstrations": {
"id": "<string>",
"name": "<string>",
"inline": {
"records": {},
"columnTypes": [
{
"name": "<string>",
"type": "<string>",
"id": "<string>"
}
]
}
},
"promptingTechnique": {
"type": "few_shot",
"demonstrations": {
"id": "<string>",
"name": "<string>",
"inline": {
"records": {},
"columnTypes": [
{
"name": "<string>",
"type": "<string>",
"id": "<string>"
}
]
}
}
},
"responseFormat": {
"type": "json_schema",
"json_schema": {
"name": "<string>",
"schema": {}
}
}
}ORGANIZATION, PROJECT 1.0 Success
ORGANIZATION, PROJECT 1Show child attributes
Show child attributes
Show child attributes
few_shot, in_context, chain_of_thought Show child attributes
Show child attributes
Was this page helpful?