Skip to main content
GET
/
api
/
v1
/
prompts
/
Typescript (SDK)
import { SyllableSDK } from "syllable-sdk";

const syllableSDK = new SyllableSDK({
  apiKeyHeader: process.env["SYLLABLESDK_API_KEY_HEADER"] ?? "",
});

async function run() {
  const result = await syllableSDK.prompts.list({
    page: 0,
    searchFields: [
      "name",
    ],
    searchFieldValues: [
      "Some Object Name",
    ],
    startDatetime: "2023-01-01T00:00:00Z",
    endDatetime: "2024-01-01T00:00:00Z",
  });

  console.log(result);
}

run();
import os
from syllable_sdk import SyllableSDK, models


with SyllableSDK(
api_key_header=os.getenv("SYLLABLESDK_API_KEY_HEADER", ""),
) as ss_client:

res = ss_client.prompts.list(page=0, limit=25, search_fields=[
models.PromptProperties.NAME,
], search_field_values=[
"Some Object Name",
], start_datetime="2023-01-01T00:00:00Z", end_datetime="2024-01-01T00:00:00Z")

# Handle response
print(res)
curl --request GET \
--url https://api.syllable.cloud/api/v1/prompts/ \
--header 'Syllable-API-Key: <api-key>'
const options = {method: 'GET', headers: {'Syllable-API-Key': '<api-key>'}};

fetch('https://api.syllable.cloud/api/v1/prompts/', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.syllable.cloud/api/v1/prompts/",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Syllable-API-Key: <api-key>"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

import (
"fmt"
"net/http"
"io"
)

func main() {

url := "https://api.syllable.cloud/api/v1/prompts/"

req, _ := http.NewRequest("GET", url, nil)

req.Header.Add("Syllable-API-Key", "<api-key>")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
HttpResponse<String> response = Unirest.get("https://api.syllable.cloud/api/v1/prompts/")
.header("Syllable-API-Key", "<api-key>")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.syllable.cloud/api/v1/prompts/")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Syllable-API-Key"] = '<api-key>'

response = http.request(request)
puts response.read_body
{
  "items": [
    {
      "name": "<string>",
      "type": "<string>",
      "llm_config": {
        "provider": "azure_openai",
        "model": "gpt-4o",
        "version": "2024-05-13",
        "api_version": "2024-06-01",
        "temperature": 1,
        "seed": 123
      },
      "id": 123,
      "last_updated": "2024-01-01T12:00:00Z",
      "description": "Prompt for a weather agent.",
      "context": "You are a weather agent. Answer the user's questions about weather and nothing else.",
      "tools": [],
      "session_end_enabled": false,
      "session_end_tool_id": 1,
      "edit_comments": "Updated prompt text to include requirement to not answer questions that aren't about weather.",
      "last_updated_by": "user@email.com",
      "session_end_tool": {
        "name": "<string>",
        "definition": {
          "tool": {
            "function": {
              "name": "<string>",
              "description": "<string>",
              "parameters": "<unknown>"
            },
            "type": "function"
          },
          "type": "endpoint",
          "endpoint": {
            "url": "<string>",
            "timeout": 45
          },
          "context": {
            "task": {
              "id": "<string>",
              "config": {},
              "variables": [
                {
                  "name": "<string>",
                  "value": "<unknown>",
                  "valueFrom": "inputs.provided_dob == patient_dob",
                  "description": "<string>",
                  "title": "<string>",
                  "format": "<string>",
                  "pattern": "<string>",
                  "enum": [
                    "<string>"
                  ],
                  "examples": [
                    "<unknown>"
                  ]
                }
              ],
              "metadata": {
                "priority": 123
              },
              "tool": {
                "name": "<string>",
                "description": "<string>"
              },
              "type": "expression",
              "version": "v1alpha",
              "inputs": [
                {
                  "name": "<string>",
                  "description": "<string>",
                  "title": "<string>",
                  "format": "<string>",
                  "pattern": "<string>",
                  "enum": [
                    "<string>"
                  ],
                  "examples": [
                    "<unknown>"
                  ],
                  "required": true
                }
              ],
              "expression": "inputs.can_sign_consent == `true`",
              "output": null,
              "on": {
                "start": [
                  {
                    "name": "<string>",
                    "value": "<unknown>",
                    "valueFrom": "inputs.provided_dob == patient_dob",
                    "if": "inputs.can_sign_consent == `true`",
                    "action": "set"
                  }
                ],
                "submit": [
                  {
                    "name": "<string>",
                    "value": "<unknown>",
                    "valueFrom": "inputs.provided_dob == patient_dob",
                    "if": "inputs.can_sign_consent == `true`",
                    "action": "set"
                  }
                ]
              }
            }
          },
          "defaults": "<unknown>",
          "static_parameters": [
            {
              "default": "fahrenheit",
              "description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
              "name": "temperature_unit",
              "required": false,
              "type": "string"
            }
          ],
          "result": "<unknown>",
          "options": {
            "propagate_tool_result": false
          }
        },
        "service_id": 123,
        "id": 123,
        "last_updated": "2023-11-07T05:31:56Z",
        "last_updated_by": "<string>",
        "version_number": 123,
        "last_updated_comments": "Updated to use new API endpoint",
        "service_name": "<string>",
        "prompts_info": [
          {
            "id": 123,
            "name": "<string>"
          }
        ],
        "agents_info": [
          {
            "id": 123,
            "name": "<string>"
          }
        ]
      },
      "agent_count": 5,
      "version_number": 1,
      "tools_full": [
        {
          "name": "<string>",
          "definition": {
            "tool": {
              "function": {
                "name": "<string>",
                "description": "<string>",
                "parameters": "<unknown>"
              },
              "type": "function"
            },
            "type": "endpoint",
            "endpoint": {
              "url": "<string>",
              "timeout": 45
            },
            "context": {
              "task": {
                "id": "<string>",
                "config": {},
                "variables": [
                  {
                    "name": "<string>",
                    "value": "<unknown>",
                    "valueFrom": "inputs.provided_dob == patient_dob",
                    "description": "<string>",
                    "title": "<string>",
                    "format": "<string>",
                    "pattern": "<string>",
                    "enum": [
                      "<string>"
                    ],
                    "examples": [
                      "<unknown>"
                    ]
                  }
                ],
                "metadata": {
                  "priority": 123
                },
                "tool": {
                  "name": "<string>",
                  "description": "<string>"
                },
                "type": "expression",
                "version": "v1alpha",
                "inputs": [
                  {
                    "name": "<string>",
                    "description": "<string>",
                    "title": "<string>",
                    "format": "<string>",
                    "pattern": "<string>",
                    "enum": [
                      "<string>"
                    ],
                    "examples": [
                      "<unknown>"
                    ],
                    "required": true
                  }
                ],
                "expression": "inputs.can_sign_consent == `true`",
                "output": null,
                "on": {
                  "start": [
                    {
                      "name": "<string>",
                      "value": "<unknown>",
                      "valueFrom": "inputs.provided_dob == patient_dob",
                      "if": "inputs.can_sign_consent == `true`",
                      "action": "set"
                    }
                  ],
                  "submit": [
                    {
                      "name": "<string>",
                      "value": "<unknown>",
                      "valueFrom": "inputs.provided_dob == patient_dob",
                      "if": "inputs.can_sign_consent == `true`",
                      "action": "set"
                    }
                  ]
                }
              }
            },
            "defaults": "<unknown>",
            "static_parameters": [
              {
                "default": "fahrenheit",
                "description": "Whether the temperature information should be fetched in Celsius or Fahrenheit",
                "name": "temperature_unit",
                "required": false,
                "type": "string"
              }
            ],
            "result": "<unknown>",
            "options": {
              "propagate_tool_result": false
            }
          },
          "service_id": 123,
          "id": 123,
          "last_updated": "2023-11-07T05:31:56Z",
          "last_updated_by": "<string>",
          "version_number": 123,
          "last_updated_comments": "Updated to use new API endpoint",
          "service_name": "<string>",
          "prompts_info": [
            {
              "id": 123,
              "name": "<string>"
            }
          ],
          "agents_info": [
            {
              "id": 123,
              "name": "<string>"
            }
          ],
          "validation_issues": [
            {
              "id": "<string>",
              "message": "<string>",
              "severity": "error",
              "path": "<string>",
              "value": "<string>"
            }
          ]
        }
      ]
    }
  ],
  "page": 123,
  "page_size": 123,
  "total_pages": 4,
  "total_count": 100
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}

Authorizations

Syllable-API-Key
string
header
required

Query Parameters

page
integer | null
default:0

The page number from which to start (0-based)

Required range: x >= 0
Example:

0

limit
integer
default:25

The maximum number of items to return

Required range: x >= 0
Example:

25

search_fields
enum<string>[]

String names of fields to search. Correspond by index to search field values

Names of prompt fields supported for filtering/sorting on list endpoint.

Available options:
id,
name,
name_exact,
description,
name_description,
context,
tools,
llm_config,
last_updated,
last_updated_by,
agent_count,
session_end_enabled
Example:

"name"

search_field_values
string[]

Values of fields to search. Correspond by index to search fields. Unless field name contains "list", an individual search field value cannot be a list

Example:

"Some Object Name"

order_by
enum<string> | null

The field whose value should be used to order the results Names of prompt fields supported for filtering/sorting on list endpoint.

Available options:
id,
name,
name_exact,
description,
name_description,
context,
tools,
llm_config,
last_updated,
last_updated_by,
agent_count,
session_end_enabled
Example:

"name"

order_by_direction
enum<string> | null

The direction in which to order the results The direction in which to order list results, either ascending or descending.

Available options:
asc,
desc
fields
enum<string>[] | null

The fields to include in the response

Names of prompt fields supported for filtering/sorting on list endpoint.

Available options:
id,
name,
name_exact,
description,
name_description,
context,
tools,
llm_config,
last_updated,
last_updated_by,
agent_count,
session_end_enabled
start_datetime
string | null

The start datetime for filtering results

Example:

"2023-01-01T00:00:00Z"

end_datetime
string | null

The end datetime for filtering results

Example:

"2024-01-01T00:00:00Z"

Response

Successful Response

items
PromptResponse · object[]
required

List of items returned from the query

page
integer
required

The page number of the results (0-based)

Example:

0

page_size
integer
required

The number of items returned per page

Example:

25

total_pages
integer | null

The total number of pages of results given the indicated page size

Example:

4

total_count
integer | null

The total number of items returned from the query

Example:

100