openai-1.0.0: Servant bindings to OpenAI
Safe HaskellSafe-Inferred
LanguageHaskell2010

OpenAI.V1.Chat.Completions

Description

/v1/chat/completions

Streaming results are not yet supported

Synopsis

Main types

data CreateChatCompletion Source #

Request body for /v1/chat/completions

Instances

Instances details
ToJSON CreateChatCompletion Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic CreateChatCompletion Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep CreateChatCompletion :: Type -> Type #

Show CreateChatCompletion Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep CreateChatCompletion Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep CreateChatCompletion = D1 ('MetaData "CreateChatCompletion" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "CreateChatCompletion" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "messages") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector (Message (Vector Content)))) :*: (S1 ('MetaSel ('Just "model") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Model) :*: S1 ('MetaSel ('Just "store") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)))) :*: (S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map Text Text))) :*: (S1 ('MetaSel ('Just "frequency_penalty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just "logit_bias") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map Word Int)))))) :*: ((S1 ('MetaSel ('Just "logprobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: (S1 ('MetaSel ('Just "top_logprobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Word)) :*: S1 ('MetaSel ('Just "max_completion_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)))) :*: (S1 ('MetaSel ('Just "n") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)) :*: (S1 ('MetaSel ('Just "modalities") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Modality))) :*: S1 ('MetaSel ('Just "prediction") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Prediction)))))) :*: (((S1 ('MetaSel ('Just "audio") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AudioParameters)) :*: (S1 ('MetaSel ('Just "presence_penalty") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just "response_format") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ResponseFormat)))) :*: (S1 ('MetaSel ('Just "seed") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Integer)) :*: (S1 ('MetaSel ('Just "service_tier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (AutoOr ServiceTier))) :*: S1 ('MetaSel ('Just "stop") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Text)))))) :*: ((S1 ('MetaSel ('Just "temperature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: (S1 ('MetaSel ('Just "top_p") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: S1 ('MetaSel ('Just "tools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Tool))))) :*: (S1 ('MetaSel ('Just "tool_choice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ToolChoice)) :*: (S1 ('MetaSel ('Just "parallel_tool_calls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Bool)) :*: S1 ('MetaSel ('Just "user") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))))))))

data ChatCompletionObject Source #

ChatCompletion body

Instances

Instances details
FromJSON ChatCompletionObject Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic ChatCompletionObject Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep ChatCompletionObject :: Type -> Type #

Show ChatCompletionObject Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep ChatCompletionObject Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

data Choice Source #

A chat completion choice

Instances

Instances details
FromJSON Choice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic Choice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep Choice :: Type -> Type #

Methods

from :: Choice -> Rep Choice x #

to :: Rep Choice x -> Choice #

Show Choice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Choice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Choice = D1 ('MetaData "Choice" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "Choice" 'PrefixI 'True) ((S1 ('MetaSel ('Just "finish_reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "index") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Natural)) :*: (S1 ('MetaSel ('Just "message") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Message Text)) :*: S1 ('MetaSel ('Just "logprobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe LogProbs)))))

data Message content Source #

A message from the conversation so far

Constructors

System 

Fields

User 

Fields

Assistant 
Tool 

Fields

Instances

Instances details
FromJSON content => FromJSON (Message content) Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Methods

parseJSON :: Value -> Parser (Message content) #

parseJSONList :: Value -> Parser [Message content] #

omittedField :: Maybe (Message content) #

ToJSON content => ToJSON (Message content) Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Methods

toJSON :: Message content -> Value #

toEncoding :: Message content -> Encoding #

toJSONList :: [Message content] -> Value #

toEncodingList :: [Message content] -> Encoding #

omitField :: Message content -> Bool #

Generic (Message content) Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep (Message content) :: Type -> Type #

Methods

from :: Message content -> Rep (Message content) x #

to :: Rep (Message content) x -> Message content #

Show content => Show (Message content) Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Methods

showsPrec :: Int -> Message content -> ShowS #

show :: Message content -> String #

showList :: [Message content] -> ShowS #

type Rep (Message content) Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep (Message content) = D1 ('MetaData "Message" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) ((C1 ('MetaCons "System" 'PrefixI 'True) (S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 content) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :+: C1 ('MetaCons "User" 'PrefixI 'True) (S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 content) :*: S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :+: (C1 ('MetaCons "Assistant" 'PrefixI 'True) ((S1 ('MetaSel ('Just "assistant_content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe content)) :*: S1 ('MetaSel ('Just "refusal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text))) :*: (S1 ('MetaSel ('Just "name") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: (S1 ('MetaSel ('Just "assistant_audio") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe AudioData)) :*: S1 ('MetaSel ('Just "tool_calls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector ToolCall)))))) :+: C1 ('MetaCons "Tool" 'PrefixI 'True) (S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 content) :*: S1 ('MetaSel ('Just "tool_call_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text))))

messageToContent :: Monoid content => Message content -> content Source #

Extract the message body from a Message

Normally this would just be the content field selector, but the problem is that the content field for the Assistant constructor is not required to be present, so we provide a utility function to default to extract the content field for all constructors, defaulting to mempty for the special case where the Message is an Assistant constructor with a missing content field

data Content Source #

A content part

Constructors

Text 

Fields

Image_URL 

Fields

Input_Audio 

Instances

Instances details
ToJSON Content Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

IsString Content Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Methods

fromString :: String -> Content #

Generic Content Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep Content :: Type -> Type #

Methods

from :: Content -> Rep Content x #

to :: Rep Content x -> Content #

Show Content Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Content Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Content = D1 ('MetaData "Content" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "Text" 'PrefixI 'True) (S1 ('MetaSel ('Just "text") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)) :+: (C1 ('MetaCons "Image_URL" 'PrefixI 'True) (S1 ('MetaSel ('Just "image_url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ImageURL)) :+: C1 ('MetaCons "Input_Audio" 'PrefixI 'True) (S1 ('MetaSel ('Just "input_audio") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 InputAudio))))

Other types

data InputAudio Source #

Audio content part

Constructors

InputAudio 

Fields

Instances

Instances details
ToJSON InputAudio Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic InputAudio Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep InputAudio :: Type -> Type #

Show InputAudio Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep InputAudio Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep InputAudio = D1 ('MetaData "InputAudio" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "InputAudio" 'PrefixI 'True) (S1 ('MetaSel ('Just "data_") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "format") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AudioFormat)))

data ImageURL Source #

Image content part

Constructors

ImageURL 

Fields

Instances

Instances details
ToJSON ImageURL Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic ImageURL Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep ImageURL :: Type -> Type #

Methods

from :: ImageURL -> Rep ImageURL x #

to :: Rep ImageURL x -> ImageURL #

Show ImageURL Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep ImageURL Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep ImageURL = D1 ('MetaData "ImageURL" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "ImageURL" 'PrefixI 'True) (S1 ('MetaSel ('Just "url") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "detail") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (AutoOr Text)))))

data AudioData Source #

Data about a previous audio response from the model. Learn more

Constructors

AudioData 

Fields

Instances

Instances details
FromJSON AudioData Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

ToJSON AudioData Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic AudioData Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep AudioData :: Type -> Type #

Show AudioData Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep AudioData Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep AudioData = D1 ('MetaData "AudioData" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "AudioData" 'PrefixI 'True) (S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Modality Source #

Output types that you would like the model to generate for this request

Instances

Instances details
ToJSON Modality Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic Modality Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep Modality :: Type -> Type #

Methods

from :: Modality -> Rep Modality x #

to :: Rep Modality x -> Modality #

Show Modality Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Modality Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Modality = D1 ('MetaData "Modality" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "Modality_Text" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Modality_Audio" 'PrefixI 'False) (U1 :: Type -> Type))

data Prediction Source #

Configuration for a Predicted Output, which can greatly improve response times when large parts of the model response are known ahead of time. This is most common when you are regenerating a file with only minor changes to most of the content

Constructors

Content 

Fields

Instances

Instances details
ToJSON Prediction Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic Prediction Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep Prediction :: Type -> Type #

Show Prediction Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Prediction Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Prediction = D1 ('MetaData "Prediction" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "Content" 'PrefixI 'True) (S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Voice Source #

The voice the model uses to respond

Constructors

Ash 
Ballad 
Coral 
Sage 
Verse 

Instances

Instances details
ToJSON Voice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic Voice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep Voice :: Type -> Type #

Methods

from :: Voice -> Rep Voice x #

to :: Rep Voice x -> Voice #

Show Voice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Methods

showsPrec :: Int -> Voice -> ShowS #

show :: Voice -> String #

showList :: [Voice] -> ShowS #

type Rep Voice Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Voice = D1 ('MetaData "Voice" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) ((C1 ('MetaCons "Ash" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Ballad" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Coral" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Sage" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Verse" 'PrefixI 'False) (U1 :: Type -> Type))))

data AudioFormat Source #

Specifies the output audio format

Constructors

WAV 
MP3 
FLAC 
Opus 
PCM16 

Instances

Instances details
ToJSON AudioFormat Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic AudioFormat Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep AudioFormat :: Type -> Type #

Show AudioFormat Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep AudioFormat Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep AudioFormat = D1 ('MetaData "AudioFormat" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) ((C1 ('MetaCons "WAV" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "MP3" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "FLAC" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Opus" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "PCM16" 'PrefixI 'False) (U1 :: Type -> Type))))

data AudioParameters Source #

Parameters for audio output

Constructors

AudioParameters 

Fields

Instances

Instances details
ToJSON AudioParameters Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic AudioParameters Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep AudioParameters :: Type -> Type #

Show AudioParameters Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep AudioParameters Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep AudioParameters = D1 ('MetaData "AudioParameters" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "AudioParameters" 'PrefixI 'True) (S1 ('MetaSel ('Just "voice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Voice) :*: S1 ('MetaSel ('Just "format") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AudioFormat)))

data ResponseFormat Source #

An object specifying the format that the model must output

Instances

Instances details
FromJSON ResponseFormat Source # 
Instance details

Defined in OpenAI.V1.ResponseFormat

ToJSON ResponseFormat Source # 
Instance details

Defined in OpenAI.V1.ResponseFormat

Generic ResponseFormat Source # 
Instance details

Defined in OpenAI.V1.ResponseFormat

Associated Types

type Rep ResponseFormat :: Type -> Type #

Show ResponseFormat Source # 
Instance details

Defined in OpenAI.V1.ResponseFormat

type Rep ResponseFormat Source # 
Instance details

Defined in OpenAI.V1.ResponseFormat

type Rep ResponseFormat = D1 ('MetaData "ResponseFormat" "OpenAI.V1.ResponseFormat" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "ResponseFormat_Text" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "JSON_Object" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "JSON_Schema" 'PrefixI 'True) (S1 ('MetaSel ('Just "json_schema") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 JSONSchema))))

data ServiceTier Source #

Specifies the latency tier to use for processing the request

Constructors

Default 

Instances

Instances details
FromJSON ServiceTier Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

ToJSON ServiceTier Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic ServiceTier Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep ServiceTier :: Type -> Type #

Show ServiceTier Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep ServiceTier Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep ServiceTier = D1 ('MetaData "ServiceTier" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "Default" 'PrefixI 'False) (U1 :: Type -> Type))

data FinishReason Source #

The reason the model stopped generating tokens

Instances

Instances details
FromJSON FinishReason Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic FinishReason Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep FinishReason :: Type -> Type #

Show FinishReason Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep FinishReason Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep FinishReason = D1 ('MetaData "FinishReason" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) ((C1 ('MetaCons "Stop" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Length" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Content_Filter" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Tool_Calls" 'PrefixI 'False) (U1 :: Type -> Type)))

data Token Source #

Message tokens with log probability information

Constructors

Token 

Fields

Instances

Instances details
FromJSON Token Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic Token Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep Token :: Type -> Type #

Methods

from :: Token -> Rep Token x #

to :: Rep Token x -> Token #

Show Token Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Methods

showsPrec :: Int -> Token -> ShowS #

show :: Token -> String #

showList :: [Token] -> ShowS #

type Rep Token Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep Token = D1 ('MetaData "Token" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "Token" 'PrefixI 'True) ((S1 ('MetaSel ('Just "token") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "logprob") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Double)) :*: (S1 ('MetaSel ('Just "bytes") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Word8))) :*: S1 ('MetaSel ('Just "top_logprobs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Token))))))

data LogProbs Source #

Log probability information for the choice

Constructors

LogProbs 

Fields

Instances

Instances details
FromJSON LogProbs Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Generic LogProbs Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

Associated Types

type Rep LogProbs :: Type -> Type #

Methods

from :: LogProbs -> Rep LogProbs x #

to :: Rep LogProbs x -> LogProbs #

Show LogProbs Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep LogProbs Source # 
Instance details

Defined in OpenAI.V1.Chat.Completions

type Rep LogProbs = D1 ('MetaData "LogProbs" "OpenAI.V1.Chat.Completions" "openai-1.0.0-DWUl3td9tpcnv1wfBaSVp" 'False) (C1 ('MetaCons "LogProbs" 'PrefixI 'True) (S1 ('MetaSel ('Just "content") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Token))) :*: S1 ('MetaSel ('Just "refusal") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Token)))))

Servant

type API = "chat" :> ("completions" :> (ReqBody '[JSON] CreateChatCompletion :> Post '[JSON] ChatCompletionObject)) Source #

Servant API