Record Class ThreadRun
java.lang.Object
java.lang.Record
io.github.stefanbratanov.jvm.openai.ThreadRun
- All Implemented Interfaces:
AssistantStreamEvent.Data
public record ThreadRun(String id, long createdAt, String threadId, String assistantId, String status, ThreadRun.RequiredAction requiredAction, LastError lastError, Long expiresAt, Long startedAt, Long cancelledAt, Long failedAt, Long completedAt, ThreadRun.IncompleteDetails incompleteDetails, String model, String instructions, List<Tool> tools, Map<String,String> metadata, Usage usage, Double temperature, Double topP, int maxPromptTokens, int maxCompletionTokens, TruncationStrategy truncationStrategy, AssistantsToolChoice toolChoice, boolean parallelToolCalls, AssistantsResponseFormat responseFormat)
extends Record
implements AssistantStreamEvent.Data
Represents an execution run on a thread.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordDetails on why the run is incomplete.static final recordDetails on the action required to continue the run. -
Constructor Summary
ConstructorsConstructorDescriptionThreadRun(String id, long createdAt, String threadId, String assistantId, String status, ThreadRun.RequiredAction requiredAction, LastError lastError, Long expiresAt, Long startedAt, Long cancelledAt, Long failedAt, Long completedAt, ThreadRun.IncompleteDetails incompleteDetails, String model, String instructions, List<Tool> tools, Map<String, String> metadata, Usage usage, Double temperature, Double topP, int maxPromptTokens, int maxCompletionTokens, TruncationStrategy truncationStrategy, AssistantsToolChoice toolChoice, boolean parallelToolCalls, AssistantsResponseFormat responseFormat) Creates an instance of aThreadRunrecord class. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theassistantIdrecord component.Returns the value of thecancelledAtrecord component.Returns the value of thecompletedAtrecord component.longReturns the value of thecreatedAtrecord component.final booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpiresAtrecord component.failedAt()Returns the value of thefailedAtrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of theincompleteDetailsrecord component.Returns the value of theinstructionsrecord component.Returns the value of thelastErrorrecord component.intReturns the value of themaxCompletionTokensrecord component.intReturns the value of themaxPromptTokensrecord component.metadata()Returns the value of themetadatarecord component.model()Returns the value of themodelrecord component.booleanReturns the value of theparallelToolCallsrecord component.Returns the value of therequiredActionrecord component.Returns the value of theresponseFormatrecord component.Returns the value of thestartedAtrecord component.status()Returns the value of thestatusrecord component.Returns the value of thetemperaturerecord component.threadId()Returns the value of thethreadIdrecord component.Returns the value of thetoolChoicerecord component.tools()Returns the value of thetoolsrecord component.topP()Returns the value of thetopPrecord component.final StringtoString()Returns a string representation of this record class.Returns the value of thetruncationStrategyrecord component.usage()Returns the value of theusagerecord component.
-
Constructor Details
-
ThreadRun
public ThreadRun(String id, long createdAt, String threadId, String assistantId, String status, ThreadRun.RequiredAction requiredAction, LastError lastError, Long expiresAt, Long startedAt, Long cancelledAt, Long failedAt, Long completedAt, ThreadRun.IncompleteDetails incompleteDetails, String model, String instructions, List<Tool> tools, Map<String, String> metadata, Usage usage, Double temperature, Double topP, int maxPromptTokens, int maxCompletionTokens, TruncationStrategy truncationStrategy, AssistantsToolChoice toolChoice, boolean parallelToolCalls, AssistantsResponseFormat responseFormat) Creates an instance of aThreadRunrecord class.- Parameters:
id- the value for theidrecord componentcreatedAt- the value for thecreatedAtrecord componentthreadId- the value for thethreadIdrecord componentassistantId- the value for theassistantIdrecord componentstatus- the value for thestatusrecord componentrequiredAction- the value for therequiredActionrecord componentlastError- the value for thelastErrorrecord componentexpiresAt- the value for theexpiresAtrecord componentstartedAt- the value for thestartedAtrecord componentcancelledAt- the value for thecancelledAtrecord componentfailedAt- the value for thefailedAtrecord componentcompletedAt- the value for thecompletedAtrecord componentincompleteDetails- the value for theincompleteDetailsrecord componentmodel- the value for themodelrecord componentinstructions- the value for theinstructionsrecord componenttools- the value for thetoolsrecord componentmetadata- the value for themetadatarecord componentusage- the value for theusagerecord componenttemperature- the value for thetemperaturerecord componenttopP- the value for thetopPrecord componentmaxPromptTokens- the value for themaxPromptTokensrecord componentmaxCompletionTokens- the value for themaxCompletionTokensrecord componenttruncationStrategy- the value for thetruncationStrategyrecord componenttoolChoice- the value for thetoolChoicerecord componentparallelToolCalls- the value for theparallelToolCallsrecord componentresponseFormat- the value for theresponseFormatrecord component
-
-
Method Details
-
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. Reference components are compared withObjects::equals(Object,Object); primitive components are compared with '=='. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
createdAt
public long createdAt()Returns the value of thecreatedAtrecord component.- Returns:
- the value of the
createdAtrecord component
-
threadId
Returns the value of thethreadIdrecord component.- Returns:
- the value of the
threadIdrecord component
-
assistantId
Returns the value of theassistantIdrecord component.- Returns:
- the value of the
assistantIdrecord component
-
status
Returns the value of thestatusrecord component.- Returns:
- the value of the
statusrecord component
-
requiredAction
Returns the value of therequiredActionrecord component.- Returns:
- the value of the
requiredActionrecord component
-
lastError
Returns the value of thelastErrorrecord component.- Returns:
- the value of the
lastErrorrecord component
-
expiresAt
Returns the value of theexpiresAtrecord component.- Returns:
- the value of the
expiresAtrecord component
-
startedAt
Returns the value of thestartedAtrecord component.- Returns:
- the value of the
startedAtrecord component
-
cancelledAt
Returns the value of thecancelledAtrecord component.- Returns:
- the value of the
cancelledAtrecord component
-
failedAt
Returns the value of thefailedAtrecord component.- Returns:
- the value of the
failedAtrecord component
-
completedAt
Returns the value of thecompletedAtrecord component.- Returns:
- the value of the
completedAtrecord component
-
incompleteDetails
Returns the value of theincompleteDetailsrecord component.- Returns:
- the value of the
incompleteDetailsrecord component
-
model
Returns the value of themodelrecord component.- Returns:
- the value of the
modelrecord component
-
instructions
Returns the value of theinstructionsrecord component.- Returns:
- the value of the
instructionsrecord component
-
tools
Returns the value of thetoolsrecord component.- Returns:
- the value of the
toolsrecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
usage
Returns the value of theusagerecord component.- Returns:
- the value of the
usagerecord component
-
temperature
Returns the value of thetemperaturerecord component.- Returns:
- the value of the
temperaturerecord component
-
topP
Returns the value of thetopPrecord component.- Returns:
- the value of the
topPrecord component
-
maxPromptTokens
public int maxPromptTokens()Returns the value of themaxPromptTokensrecord component.- Returns:
- the value of the
maxPromptTokensrecord component
-
maxCompletionTokens
public int maxCompletionTokens()Returns the value of themaxCompletionTokensrecord component.- Returns:
- the value of the
maxCompletionTokensrecord component
-
truncationStrategy
Returns the value of thetruncationStrategyrecord component.- Returns:
- the value of the
truncationStrategyrecord component
-
toolChoice
Returns the value of thetoolChoicerecord component.- Returns:
- the value of the
toolChoicerecord component
-
parallelToolCalls
public boolean parallelToolCalls()Returns the value of theparallelToolCallsrecord component.- Returns:
- the value of the
parallelToolCallsrecord component
-
responseFormat
Returns the value of theresponseFormatrecord component.- Returns:
- the value of the
responseFormatrecord component
-