You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi there, with more and more models supporting function calling now, I am missing a way to pass a list of functions (tools) to the client. This what works perfectly calling the API:
model="llama3.1:70b"tools= [
{
"type": "function",
"function": {
"name": "retrieve_payment_status",
"description": "Get payment status of a transaction",
"parameters": {
"type": "object",
"properties": {
"transaction_id": {
"type": "string",
"description": "The transaction id."
}
},
"required": ["transaction_id"]
}
}
},
{
"type": "function",
"function": {
"name": "retrieve_payment_date",
"description": "Get payment date of a transaction",
"parameters": {
"type": "object",
"properties": {
"transaction_id": {
"type": "string",
"description": "The transaction id."
}
},
"required": ["transaction_id"]
}
}
}
]
messages= [
{
"content": "What is the status and payment date of my transaction T1001?",
"role": "user"
}
]
data= {
"messages": messages,
"tools": tools,
"model": model,
"temperature": 0.3
}
response=requests.post('http://localhost:11434/v1/chat/completions',
headers={"Content-Type": "application/json"},
json=data)
With this, I get a response with the different tool choices and their parameters.
However, I am missing the feature to pass the list of tools to the client. I was thinking of something like this:
Hi there, with more and more models supporting function calling now, I am missing a way to pass a list of functions (tools) to the client. This what works perfectly calling the API:
With this, I get a response with the different tool choices and their parameters.
However, I am missing the feature to pass the list of tools to the client. I was thinking of something like this:
Is there a way to do this without passing the tools into the system prompt? Apologies if I didn't find it elsewhere.
The text was updated successfully, but these errors were encountered: