Class OpenAITool

java.lang.Object
io.agentscope.core.chat.completions.model.OpenAITool

public class OpenAITool extends Object
OpenAI tool definition for Chat Completions API requests.

This class represents a tool that can be called by the model, following OpenAI's format.

Example:


 {
   "type": "function",
   "function": {
     "name": "get_weather",
     "description": "Get the current weather",
     "parameters": {
       "type": "object",
       "properties": {
         "location": {"type": "string"}
       },
       "required": ["location"]
     }
   }
 }
 
  • Constructor Details

    • OpenAITool

      public OpenAITool()
      Default constructor for deserialization.
    • OpenAITool

      public OpenAITool(OpenAIToolFunction function)
      Creates a new OpenAITool with the specified function.
      Parameters:
      function - The function definition
  • Method Details