Files
go-openai/examples
mikeb26 a09cb0c528 Add completion-with-tool example (#598)
As a user of this go SDK it was not immediately intuitive to me how to
correctly utilize the function calling capability of GPT4
(https://platform.openai.com/docs/guides/function-calling). While the
aformentioned link provides a helpful example written in python, I
initially tripped over how to correclty translate the specification of
function arguments when usingthis go SDK.

To make it easier for others in the future this commit adds a
completion-with-tool example showing how to correctly utilize the
function calling capability of GPT4 using this SDK end-to-end in a
CreateChatCompletion() sequence.
2023-11-26 12:45:28 +04:00
..

To run an example:

export OPENAI_API_KEY="<your key here>"
go run ./example/<target>