ChatRequestResponseData

sttp.openai.requests.completions.chat.ChatRequestResponseData

Attributes

Graph
Supertypes
class Object
trait Matchable
class Any
Self type

Members list

Type members

Classlikes

case class ChatResponse(id: String, choices: Seq[Choices], created: Int, model: String, `object`: String, usage: Usage, systemFingerprint: Option[String], serviceTier: Option[String])

Represents the response of a chat completion.

Represents the response of a chat completion.

Value parameters

`object`

The object type, which is always chat.completion.

choices

A list of chat completion choices. Can be more than one if n is greater than 1.

created

The Unix timestamp (in seconds) of when the chat completion was created.

id

A unique identifier for the chat completion.

model

The model used for the chat completion.

serviceTier

The service tier used for processing the request.

systemFingerprint

This fingerprint represents the backend configuration that the model runs with. Can be used in conjunction with the seed request parameter to understand when backend changes have been made that might impact determinism.

usage

Usage statistics for the completion request.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ChatResponse

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Choices(message: Message, finishReason: String, index: Int, logprobs: Option[Logprobs])

Represents a choice in the chat completion.

Represents a choice in the chat completion.

Value parameters

finishReason

The reason the model stopped generating tokens. This will be stop if the model hit a natural stop point or a provided stop sequence, length if the maximum number of tokens specified in the request was reached, content_filter if content was omitted due to a flag from our content filters, tool_calls if the model called a tool, or function_call (deprecated) if the model called a function.

index

The index of this choice.

logprobs

Log probability information for the choice.

message

The message associated with this choice.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Choices

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Choices.type
case class DeleteChatCompletionResponse(`object`: String, id: String, deleted: Boolean)

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ListChatResponse(`object`: String, data: Seq[ChatResponse], firstId: String, lastId: String, hasMore: Boolean)

An object representing a list of chat completions.

An object representing a list of chat completions.

Value parameters

`object`

The type of this object. It is always set to "list".

data

An array of chat completion objects.

firstId

The identifier of the first chat completion in the data array.

hasMore

Indicates whether there are more chat completions available.

lastId

The identifier of the last chat completion in the data array.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class ListMessageResponse(`object`: String, data: Seq[Message], firstId: String, lastId: String, hasMore: Boolean)

An object representing a list of chat completion messages.

An object representing a list of chat completion messages.

Value parameters

`object`

The type of this object. It is always set to "list".

data

An array of chat completion message objects.

firstId

The identifier of the first chat message in the data array.

hasMore

Indicates whether there are more chat messages available.

lastId

The identifier of the last chat message in the data array.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class LogprobData(token: String, logprob: Float, bytes: Option[Seq[Int]], topLogprobs: Seq[TopLogprobs])

Value parameters

bytes

A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.

logprob

The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely.

token

The token.

topLogprobs

List of the most likely tokens and their log probability, at this token position. In rare cases, there may be fewer than the number of requested top_logprobs returned.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object LogprobData

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class Logprobs(content: Option[Seq[LogprobData]], refusal: Option[Seq[LogprobData]])

Value parameters

content

A list of message content tokens with log probability information.

refusal

A list of message refusal tokens with log probability information.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Logprobs

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Logprobs.type
case class Message(content: String, refusal: Option[String], toolCalls: Seq[ToolCall], role: Role, functionCall: Option[FunctionCall], audio: Option[Audio], id: String)

Value parameters

audio

If the audio output modality is requested, this object contains data about the audio response from the model. Learn more.

content

The contents of the message.

functionCall

The name and arguments of a function that should be called, as generated by the model.

id

The identifier of the chat message.

refusal

The refusal message generated by the model.

role

The role of the author of this message.

toolCalls

The tool calls generated by the model, such as function calls.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Message

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Message.type
case class TopLogprobs(token: String, logprob: Float, bytes: Option[Seq[Int]])

Value parameters

bytes

A list of integers representing the UTF-8 bytes representation of the token. Useful in instances where characters are represented by multiple tokens and their byte representations must be combined to generate the correct text representation. Can be null if there is no bytes representation for the token.

logprob

The log probability of this token, if it is within the top 20 most likely tokens. Otherwise, the value -9999.0 is used to signify that the token is very unlikely.

token

The token.

Attributes

Companion
object
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TopLogprobs

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type