Skip to content

Instantly share code, notes, and snippets.

@data2json
Created July 27, 2024 02:22
Show Gist options
  • Save data2json/935757b96b5dc14e7dc954e7c25f35a7 to your computer and use it in GitHub Desktop.
Save data2json/935757b96b5dc14e7dc954e7c25f35a7 to your computer and use it in GitHub Desktop.
curl -s -X POST 'http://0.0.0.0:8000/v1/chat/completions' -H "Content-Type: application/json" -d '{
"model": "gpt-3.5-turbo",
"messages": [
{
"role": "system",
"content": "Environment: ipython\nTools: brave_search, wolfram_alpha\n\nCutting Knowledge Date: December 2023\nToday Date: 23 Jul 2024\n\nYou are a helpful Assistant."
},
{
"role": "user",
"content": "Can you help me solve this equation: x^3 - 4x^2 + 6x - 24 = 0"
}
],
"max_tokens": 4098,
"n": 1,
"temperature": 0.001,
"top_p": 0.001
}' | jq
{
"id": "chat-7dbf4412debc4be1bf95be61e46e56ce",
"object": "chat.completion",
"created": 1722046711,
"model": "gpt-3.5-turbo",
"choices": [
{
"index": 0,
"message": {
"role": "assistant",
"content": "<|python_tag|>from sympy import symbols, Eq, solve\n\n# Define the variable\nx = symbols('x')\n\n# Define the equation\nequation = Eq(x**3 - 4*x**2 + 6*x - 24, 0)\n\n# Solve the equation\nsolution = solve(equation, x)\n\nprint(solution)",
"tool_calls": []
},
"logprobs": null,
"finish_reason": "stop",
"stop_reason": 128008
}
],
"usage": {
"prompt_tokens": 82,
"total_tokens": 151,
"completion_tokens": 69
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment