curl -X POST \
'https://{url}/ml/v1/text/chat?version=2024-10-08' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer eyJraWQiOi...'
--data '{"model_id":"mistralai/mistral-large","project_id":"4947c695-a374-428c-acca-332c1a1dc9e9","messages":[{"role":"user","content":[{"type":"text","text":"What is 2 plus 4?"}]}],"tools":[{"type":"function","function":{"name":"add","description":"Adds the values a and b to get a sum.","parameters":{"type":"object","properties":{"a":{"description":"A number value","type":"float"},"b":{"description":"A number value","type":"float"}},"required":["a","b"]}}},{"type":"function","function":{"name":"multiply","description":"Multiplies the values a and b.","parameters":{"type":"object","properties":{"a":{"description":"A number value","type":"float"},"b":{"description":"A number value","type":"float"}},"required":["a","b"]}}}],"tool_choice_option":"auto","max_tokens":300,"time_limit":1000}'
{"id":"chatcmpl-2f47da4026950db321698cb733b25e89","model_id":"mistralai/mistral-large","model":"mistralai/mistral-large","choices":[{"index":0,"message":{"role":"assistant","tool_calls":[{"id":"H6KoCbaZV","type":"function","function":{"name":"add","arguments":"{\"a\": 2, \"b\": 4}"}}]},"finish_reason":"tool_calls"}],"created":1739311926,"model_version":"2.0.0","created_at":"2025-02-11T22:12:07.243Z","usage":{"completion_tokens":25,"prompt_tokens":189,"total_tokens":214},"system":{"warnings":[{"message":"This model is a Non-IBM Product governed by a third-party license that may impose use restrictions and other obligations. By using this model you agree to its terms as identified in the following URL.","id":"disclaimer_warning","more_info":"https://dataplatform.cloud.ibm.com/docs/content/wsj/analyze-data/fm-models.html?context=wx"}]}}
{"model_id":"ibm/granite-3-2b-instruct","project_id":"4947c695-a374-428c-acca-332c1a1dc9e9","messages":[{"role":"system","content":[{"type":"text","text":"You are Granite, developed by IBM. You are a helpful AI assistant with access to the following tools. When a tool is required to answer the user's query, respond with <|tool_call|> followed by a JSON list of tools used. If a tool does not exist in the provided list of tools, notify the user that you do not have the ability to fulfill the request."}]},{"role":"user","content":[{"type":"text","text":"What is 2 times 4?"}]}],"tools":[{"type":"function","function":{"name":"add","description":"Adds the values a and b to get a sum.","parameters":{"type":"object","properties":{"a":{"description":"A number value","type":"float"},"b":{"description":"A number value","type":"float"}},"required":["a","b"]}}},{"type":"function","function":{"name":"multiply","description":"Multiplies the values a and b.","parameters":{"type":"object","properties":{"a":{"description":"A number value","type":"float"},"b":{"description":"A number value","type":"float"}},"required":["a","b"]}}}],"tool_choice_option":"auto","max_tokens":300,"time_limit":10000}