palmyra-fin
, palmyra-med
, or palmyra-creative
.
For example, in a chat application using Palmyra X5, you can delegate financial analysis tasks to the palmyra-fin
model.
This guide helps you understand how to perform model delegation using the Writer API.
.env
file with the name WRITER_API_KEY
.tools
array in your chat-completion
endpoint request.
The LLM tool object has the following structure:
Parameter | Type | Description |
---|---|---|
type | string | The type of tool, which is llm for LLM tool |
function | object | An object containing the tool’s description and model |
function.description | string | A description of what the model will be used for. |
function.model | string | The ID of the Writer model to be used for this tool |
function.description
parameter:palmyra-med
model:“A function that invokes the LLM identified by the given model, specialized in answering medical queries. Any user request asking for medical advice should use this tool.”
tools
array at a time. However, you can pass multiple custom tools in the same request.Prebuilt tools are:llm_data
object. The llm_data
object contains the following fields:
Parameter | Type | Description |
---|---|---|
prompt | string | The prompt used by the LLM tool. |
model | string | The ID of the Writer model used by the LLM tool. |
palmyra-med
.
palmyra-med
model.
tools
array that specifies the Writer model you want to use.
tool_choice
to auto
allows the model to choose when to use the LLM tool, based on the user’s question and the description of the tool.
This example streams the response as the model generates it.
If you are unfamiliar with the chat completions endpoint or streaming vs. non-streaming responses, learn more in the chat completion guide.