Package com.aispect.core.client.model
Record Class PromptContext
java.lang.Object
java.lang.Record
com.aispect.core.client.model.PromptContext
- Record Components:
systemPrompt- System-level prompt words used to define the basic identity or global specification of the modelmessages- List of historical conversation informationtools- A collection of external utility functions that the model is allowed to use in this call (optional)
public record PromptContext(String systemPrompt, List<Message> messages, List<Object> tools)
extends Record
Encapsulate a single AI Prompt contextual information during interaction.
Contains system prompt words (System Prompt)、Historical conversation messages, and mounted tool call information (Function Calling)。
-
Constructor Summary
ConstructorsConstructorDescriptionPromptContext(String systemPrompt, List<Message> messages) Creates an instance of aPromptContextrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.messages()Returns the value of themessagesrecord component.Returns the value of thesystemPromptrecord component.tools()Returns the value of thetoolsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
PromptContext
-
PromptContext
Creates an instance of aPromptContextrecord class.- Parameters:
systemPrompt- the value for thesystemPromptrecord componentmessages- the value for themessagesrecord componenttools- the value for thetoolsrecord 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. All components in this record class are compared withObjects::equals(Object,Object). -
systemPrompt
Returns the value of thesystemPromptrecord component.- Returns:
- the value of the
systemPromptrecord component
-
messages
Returns the value of themessagesrecord component.- Returns:
- the value of the
messagesrecord component
-
tools
Returns the value of thetoolsrecord component.- Returns:
- the value of the
toolsrecord component
-