Slide 25
Slide 25 text
§ Integrate LLM-external systems to
aid LLMs
§ Tool / function calling standard
established by OpenAI
§ LLM outputs JSON conforming to
a schema
§ LLM does not call a function
§ All major libs support tool calling
§ OpenAI SDKs
§ LangChain
§ Semantic Kernel
§ etc.
§ You wire up the logic in your code
Large Language Models
Szenarien, Use Cases & Patterns für Business-Anwendungen - in Action
2. Extending LLM capabilities
25
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"
}'