Closed irthomasthomas closed 2 days ago
Notes:
Neither the prefill, not the stop sequence are included in the response.
llm -m claude-3.5-sonnet -o prefill "<PLAN>" "Surprise me with a dbus shell function" -o stop_sequences '["</PLAN>"]'
1. Create a D-Bus shell function that does something unexpected or interesting
2. Include comments explaining what the function does
3. Make sure it's a valid shell function that can be used in a bash script
4. Add some error handling and parameter checking
{"stop_sequences": ["</PLAN>"], "prefill": "<PLAN>", "max_tokens": 8192, "temperature": 1.0}
If you use multiple stop_sequences, you can determine which was received from the response_json:
{
"id": "msg_01MTH7xDebox1v8VPqH9nVoG",
"content": [
{
"text": "\n1. Create a D-Bus shell function that does something unexpected or interesting\n2. Include comments explaining what the function does\n3. Make sure it's a valid shell function that can be used in a bash script\n4. Add some error handling and parameter checking\n",
"type": "text"
}
],
"model": "claude-3-5-sonnet-20240620",
"role": "assistant",
"stop_reason": "stop_sequence",
"stop_sequence": "</PLAN>",
"type": "message",
"usage": {
"input_tokens": 21,
"output_tokens": 60
}
}
stop_sequences
option inClaudeOptions
to allow users to specify sequences that will terminate text generation.prefill
option to provide a starting point for text generation.ClaudeOptions
forstop_sequences
to ensure proper format.ClaudeMessages
class to include prefill text when provided.Files changed: