Closed pedroaurelli closed 5 months ago
Issue create to request support to tool and tool_choice functions to Chat completion body requests.
tool
tool_choice
Example using nodejs by openAi documentation:
import OpenAI from "openai"; const openai = new OpenAI(); async function main() { const messages = [{"role": "user", "content": "What's the weather like in Boston today?"}]; const 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"], }, } } ]; const response = await openai.chat.completions.create({ model: "gpt-4-turbo", messages: messages, tools: tools, tool_choice: "auto", }); console.log(response); } main();
OpenAI documentation: https://platform.openai.com/docs/api-reference/chat/create
#
Tool
ToolChoice
DefaultCompletionRequestArgs
Client.Chats
Client.Completions
The new beta version of the package supports this, see https://devblogs.microsoft.com/dotnet/openai-dotnet-library/ for the announcement
Issue create to request support to
tool
andtool_choice
functions to Chat completion body requests.Example using nodejs by openAi documentation:
OpenAI documentation: https://platform.openai.com/docs/api-reference/chat/create
#
Suggest
Tool
andToolChoice
toDefaultCompletionRequestArgs
forClient.Chats
andClient.Completions