OpenAIToolHelper

org.llm4s.toolapi.OpenAIToolHelper

Converts a ToolRegistry into the tool definitions of OpenAI's Java SDK (com.openai:openai-java), which OpenAIClient sends for OpenAI, Azure OpenAI and Requesty.

This replaces AzureToolHelper, whose methods took and returned types from Microsoft's deprecated com.azure:azure-ai-openai SDK; llm4s-openai moved off that SDK in #1132.

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Value members

Concrete methods

def addToolsToParams(toolRegistry: ToolRegistry, params: Builder): Builder

Sets the registry's tools on a chat-completions request builder.

Sets the registry's tools on a chat-completions request builder.

Value parameters

params

The request builder to add the tools to

toolRegistry

The tool registry containing the tools

Attributes

Returns

The same builder, for chaining

def convertToolRegistryToOpenAITools(toolRegistry: ToolRegistry): List[ChatCompletionTool]

Converts a ToolRegistry to chat-completions tool definitions, one function tool per registered tool, in registry order.

Converts a ToolRegistry to chat-completions tool definitions, one function tool per registered tool, in registry order.

Value parameters

toolRegistry

The tool registry to convert

Attributes

Returns

The tool definitions