Package com.axelor.ai.chat
Record Class UIPart.Tool
java.lang.Object
java.lang.Record
com.axelor.ai.chat.UIPart.Tool
- All Implemented Interfaces:
UIPart
- Enclosing interface:
UIPart
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface com.axelor.ai.chat.UIPart
UIPart.Custom, UIPart.Data, UIPart.File, UIPart.Reasoning, UIPart.ReasoningFile, UIPart.SourceDocument, UIPart.SourceUrl, UIPart.StepStart, UIPart.Text, UIPart.Tool, UIPart.TypeResolver -
Constructor Summary
ConstructorsConstructorDescriptionTool(String toolCallId, String toolName, String state, Object input, Object output, String errorText, Map<String, Object> callProviderMetadata, UIPart.Tool.ToolApproval approval, Map<String, Object> toolMetadata, String title) Creates an instance of aToolrecord class.Tool(String toolCallId, String toolName, String type, String state, Object input, Object output, String errorText, Map<String, Object> callProviderMetadata, UIPart.Tool.ToolApproval approval, Map<String, Object> toolMetadata, String title) The AI SDK encodes the tool name in thetypefield (e.g. -
Method Summary
Modifier and TypeMethodDescriptionapproval()Returns the value of theapprovalrecord component.Returns the value of thecallProviderMetadatarecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theerrorTextrecord component.final inthashCode()Returns a hash code value for this object.input()Returns the value of theinputrecord component.static booleanisPendingState(String state) True whenstatehasn't reached a terminal outcome yet.output()Returns the value of theoutputrecord component.state()Returns the value of thestaterecord component.title()Returns the value of thetitlerecord component.Returns the value of thetoolCallIdrecord component.Returns the value of thetoolMetadatarecord component.toolName()Returns the value of thetoolNamerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Tool
public Tool(String toolCallId, String toolName, String type, String state, Object input, Object output, String errorText, Map<String, Object> callProviderMetadata, UIPart.Tool.ToolApproval approval, Map<String, Object> toolMetadata, String title) The AI SDK encodes the tool name in thetypefield (e.g."tool-askToInput") and does not send a separatetoolNameproperty. This creator extracts the tool name fromtypewhentoolNameis absent. -
Tool
public Tool(String toolCallId, String toolName, String state, Object input, Object output, String errorText, Map<String, Object> callProviderMetadata, UIPart.Tool.ToolApproval approval, Map<String, Object> toolMetadata, String title) Creates an instance of aToolrecord class.- Parameters:
toolCallId- the value for thetoolCallIdrecord componenttoolName- the value for thetoolNamerecord componentstate- the value for thestaterecord componentinput- the value for theinputrecord componentoutput- the value for theoutputrecord componenterrorText- the value for theerrorTextrecord componentcallProviderMetadata- the value for thecallProviderMetadatarecord componentapproval- the value for theapprovalrecord componenttoolMetadata- the value for thetoolMetadatarecord componenttitle- the value for thetitlerecord component
-
-
Method Details
-
isPendingState
True whenstatehasn't reached a terminal outcome yet. -
toString
Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components. -
hashCode
public final int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
toolCallId
Returns the value of thetoolCallIdrecord component.- Returns:
- the value of the
toolCallIdrecord component
-
toolName
Returns the value of thetoolNamerecord component.- Returns:
- the value of the
toolNamerecord component
-
state
Returns the value of thestaterecord component.- Returns:
- the value of the
staterecord component
-
input
Returns the value of theinputrecord component.- Returns:
- the value of the
inputrecord component
-
output
Returns the value of theoutputrecord component.- Returns:
- the value of the
outputrecord component
-
errorText
Returns the value of theerrorTextrecord component.- Returns:
- the value of the
errorTextrecord component
-
callProviderMetadata
Returns the value of thecallProviderMetadatarecord component.- Returns:
- the value of the
callProviderMetadatarecord component
-
approval
Returns the value of theapprovalrecord component.- Returns:
- the value of the
approvalrecord component
-
toolMetadata
Returns the value of thetoolMetadatarecord component.- Returns:
- the value of the
toolMetadatarecord component
-
title
Returns the value of thetitlerecord component.- Returns:
- the value of the
titlerecord component
-