Skip to content

Instantly share code, notes, and snippets.

View philipp-meier's full-sized avatar

Philipp Meier philipp-meier

View GitHub Profile
@philipp-meier
philipp-meier / OpenAiFunctionCallingExample.md
Last active August 10, 2024 18:58
OpenAI function calling example

OpenAI function calling example

Example curl requests for OpenAI's function calling API using a local Ollama docker container with the llama3.1 model.

Step 1:
Ask the LLM a question and provide the function it can call to gather the required information.
In this case, we want to know the current weather and provide the get_current_weather function definition.

Note: If you use a local Ollama instance, you can remove the "Authorization"-header.