AI SDKs
OpenAI
How to use Agentic with the OpenAI TS SDK directly.
There’s no need for an adapter with the OpenAI SDK since all agentic tools are
compatible with OpenAI by default. You can use AIFunctionSet.specs
for
function calling or AIFunctionSet.toolSpecs
for parallel tool calling.
Install
Usage
Running this example
You’ll need a free API key from weatherapi.com
to run this example. Store it in a local .env
file as WEATHER_API_KEY
.
You’ll need an OpenAI API key
to run this example. Store it in a local .env
file as OPENAI_API_KEY
.