Slide 18
Slide 18 text
§ Predefined JSON schema
structure
§ All major libs support
tool calling with abstractions
§ OpenAI SDKs
§ Langchain
§ Semantic Kernel
§ Etc.
'Talk to your systems'
Structured data & tool integration with LLMs
OpenAI Tool calling
– plain HTTP calls
curl https://api.openai.com/v1/chat/completions \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $OPENAI_API_KEY" \
-d '{
"model": "gpt-4o",
"messages": [
{
"role": "user",
"content": "What is the weather like in Boston?"
}
],
"tools": [
{
"type": "function",
"function": {
"name": "get_current_weather",
"description": "Get the current weather in a given location",
"parameters": {
"type": "object",
"properties": {
"location": {
"type": "string",
"description": "The city and state, e.g. San Francisco, CA"
},
"unit": {
"type": "string",
"enum": ["celsius", "fahrenheit"]
}
},
"required": ["location"]
}
}
}
],
"tool_choice": "auto"
}'
https://platform.openai.com/docs/api-reference/chat/create#chat-create-tools 18