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

OpenAI.V1.Threads.Runs

Description

/v1/threads/:thread_id/runs
Synopsis

Main types

newtype RunID Source #

Run ID

Constructors

RunID 

Fields

data CreateRun Source #

Request body for /v1/threads/:thread_id/runs

Instances

Instances details
ToJSON CreateRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic CreateRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep CreateRun :: Type -> Type #

Show CreateRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep CreateRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep CreateRun = D1 ('MetaData "CreateRun" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "CreateRun" 'PrefixI 'True) (((S1 ('MetaSel ('Just "assistant_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssistantID) :*: (S1 ('MetaSel ('Just "model") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Model)) :*: S1 ('MetaSel ('Just "instructions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "additional_instructions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "additional_messages") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Message)))) :*: (S1 ('MetaSel ('Just "tools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Tool))) :*: S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map Text 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 "max_prompt_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "max_completion_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)))) :*: ((S1 ('MetaSel ('Just "truncation_strategy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe TruncationStrategy)) :*: 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 "response_format") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (AutoOr ResponseFormat))))))))

data CreateThreadAndRun Source #

Request body for /v1/threads/runs

Instances

Instances details
ToJSON CreateThreadAndRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic CreateThreadAndRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep CreateThreadAndRun :: Type -> Type #

Show CreateThreadAndRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep CreateThreadAndRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep CreateThreadAndRun = D1 ('MetaData "CreateThreadAndRun" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "CreateThreadAndRun" 'PrefixI 'True) (((S1 ('MetaSel ('Just "assistant_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssistantID) :*: (S1 ('MetaSel ('Just "thread") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Thread)) :*: S1 ('MetaSel ('Just "model") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Model)))) :*: ((S1 ('MetaSel ('Just "instructions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "tools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Vector Tool)))) :*: (S1 ('MetaSel ('Just "toolResources") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe ToolResources)) :*: S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map Text 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 "max_prompt_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "max_completion_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)))) :*: ((S1 ('MetaSel ('Just "truncation_strategy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe TruncationStrategy)) :*: 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 "response_format") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (AutoOr ResponseFormat))))))))

data ModifyRun Source #

Request body for /v1/threads/:thread_id/runs/:run_id

Constructors

ModifyRun 

Fields

Instances

Instances details
ToJSON ModifyRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic ModifyRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep ModifyRun :: Type -> Type #

Show ModifyRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep ModifyRun Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep ModifyRun = D1 ('MetaData "ModifyRun" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "ModifyRun" 'PrefixI 'True) (S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Map Text Text)))))

data SubmitToolOutputsToRun Source #

Request body for /v1/threads/:thread_id/runs/:run_id/submit_tool_outputs

Constructors

SubmitToolOutputsToRun 

Fields

data RunObject Source #

Represents an execution run on a thread.

Instances

Instances details
FromJSON RunObject Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic RunObject Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep RunObject :: Type -> Type #

Show RunObject Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep RunObject Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep RunObject = D1 ('MetaData "RunObject" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "RunObject" 'PrefixI 'True) ((((S1 ('MetaSel ('Just "id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 RunID) :*: (S1 ('MetaSel ('Just "object") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text) :*: S1 ('MetaSel ('Just "created_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 POSIXTime))) :*: (S1 ('MetaSel ('Just "thread_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ThreadID) :*: (S1 ('MetaSel ('Just "assistant_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 AssistantID) :*: S1 ('MetaSel ('Just "status") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Status)))) :*: ((S1 ('MetaSel ('Just "required_action") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe RequiredAction)) :*: (S1 ('MetaSel ('Just "last_error") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Error)) :*: S1 ('MetaSel ('Just "expires_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)))) :*: ((S1 ('MetaSel ('Just "started_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)) :*: S1 ('MetaSel ('Just "cancelled_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime))) :*: (S1 ('MetaSel ('Just "failed_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)) :*: S1 ('MetaSel ('Just "completed_at") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe POSIXTime)))))) :*: (((S1 ('MetaSel ('Just "incomplete_details") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe IncompleteDetails)) :*: (S1 ('MetaSel ('Just "model") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Model) :*: S1 ('MetaSel ('Just "instructions") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)))) :*: ((S1 ('MetaSel ('Just "tools") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector Tool)) :*: S1 ('MetaSel ('Just "metadata") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Map Text Text))) :*: (S1 ('MetaSel ('Just "usage") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe (Usage (Maybe Void) (Maybe Void)))) :*: S1 ('MetaSel ('Just "temperature") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double))))) :*: ((S1 ('MetaSel ('Just "top_p") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Double)) :*: (S1 ('MetaSel ('Just "max_prompt_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)) :*: S1 ('MetaSel ('Just "max_completion_tokens") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural)))) :*: ((S1 ('MetaSel ('Just "truncation_strategy") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe TruncationStrategy)) :*: S1 ('MetaSel ('Just "tool_choice") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ToolChoice)) :*: (S1 ('MetaSel ('Just "parallel_tool_calls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Bool) :*: S1 ('MetaSel ('Just "response_format") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (AutoOr ResponseFormat))))))))

Other types

data TruncationStrategy Source #

Controls for how a thread will be truncated prior to the run

Constructors

Auto 
Last_Messages 

Instances

Instances details
FromJSON TruncationStrategy Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

ToJSON TruncationStrategy Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic TruncationStrategy Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep TruncationStrategy :: Type -> Type #

Show TruncationStrategy Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep TruncationStrategy Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep TruncationStrategy = D1 ('MetaData "TruncationStrategy" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "Auto" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Last_Messages" 'PrefixI 'True) (S1 ('MetaSel ('Just "last_messages") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Natural))))

data SubmitToolOutputs Source #

Details on the tool outputs needed for this run to continue.

Constructors

SubmitToolOutputs 

Fields

Instances

Instances details
FromJSON SubmitToolOutputs Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic SubmitToolOutputs Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep SubmitToolOutputs :: Type -> Type #

Show SubmitToolOutputs Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep SubmitToolOutputs Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep SubmitToolOutputs = D1 ('MetaData "SubmitToolOutputs" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "SubmitToolOutputs" 'PrefixI 'True) (S1 ('MetaSel ('Just "tool_calls") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Vector ToolCall))))

data RequiredAction Source #

Details on the action required to continue the run

Instances

Instances details
FromJSON RequiredAction Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic RequiredAction Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep RequiredAction :: Type -> Type #

Show RequiredAction Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep RequiredAction Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep RequiredAction = D1 ('MetaData "RequiredAction" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "RequiredAction_Submit_Tool_Outputs" 'PrefixI 'True) (S1 ('MetaSel ('Just "submit_tool_outputs") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 SubmitToolOutputs)))

data IncompleteDetails Source #

Details on why the run is incomplete

Constructors

IncompleteDetails 

Fields

Instances

Instances details
FromJSON IncompleteDetails Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic IncompleteDetails Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep IncompleteDetails :: Type -> Type #

Show IncompleteDetails Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep IncompleteDetails Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep IncompleteDetails = D1 ('MetaData "IncompleteDetails" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "IncompleteDetails" 'PrefixI 'True) (S1 ('MetaSel ('Just "reason") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data ToolOutput Source #

A tool for which the output is being submitted

Constructors

ToolOutput 

Instances

Instances details
ToJSON ToolOutput Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic ToolOutput Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep ToolOutput :: Type -> Type #

Show ToolOutput Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep ToolOutput Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep ToolOutput = D1 ('MetaData "ToolOutput" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (C1 ('MetaCons "ToolOutput" 'PrefixI 'True) (S1 ('MetaSel ('Just "tool_call_id") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (Maybe Text)) :*: S1 ('MetaSel ('Just "output") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 Text)))

data Status Source #

The status of the run

Instances

Instances details
FromJSON Status Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Generic Status Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

Associated Types

type Rep Status :: Type -> Type #

Methods

from :: Status -> Rep Status x #

to :: Rep Status x -> Status #

Show Status Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep Status Source # 
Instance details

Defined in OpenAI.V1.Threads.Runs

type Rep Status = D1 ('MetaData "Status" "OpenAI.V1.Threads.Runs" "openai-1.0.1-3DuKyEdOLg0ITkiRYLcBus" 'False) (((C1 ('MetaCons "Queued" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "In_Progress" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Requires_Action" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Cancelling" 'PrefixI 'False) (U1 :: Type -> Type))) :+: ((C1 ('MetaCons "Cancelled" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Failed" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Completed" 'PrefixI 'False) (U1 :: Type -> Type) :+: (C1 ('MetaCons "Incomplete" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Expired" 'PrefixI 'False) (U1 :: Type -> Type)))))

Servant

type API = "threads" :> (Header' '[Required, Strict] "OpenAI-Beta" Text :> ((Capture "thread_id" ThreadID :> ("runs" :> (QueryParam "include[]" Text :> (ReqBody '[JSON] CreateRun :> Post '[JSON] RunObject)))) :<|> (("runs" :> (ReqBody '[JSON] CreateThreadAndRun :> Post '[JSON] RunObject)) :<|> ((Capture "thread_id" ThreadID :> ("runs" :> (QueryParam "limit" Natural :> (QueryParam "order" Order :> (QueryParam "after" Text :> (QueryParam "before" Text :> Get '[JSON] (ListOf RunObject))))))) :<|> ((Capture "thread_id" ThreadID :> ("runs" :> (Capture "run_id" RunID :> Get '[JSON] RunObject))) :<|> ((Capture "thread_id" ThreadID :> ("runs" :> (Capture "run_id" RunID :> (ReqBody '[JSON] ModifyRun :> Post '[JSON] RunObject)))) :<|> ((Capture "thread_id" ThreadID :> ("runs" :> (Capture "run_id" RunID :> ("submit_tool_outputs" :> (ReqBody '[JSON] SubmitToolOutputsToRun :> Post '[JSON] RunObject))))) :<|> (Capture "thread_id" ThreadID :> ("runs" :> (Capture "run_id" RunID :> ("cancel" :> Post '[JSON] RunObject))))))))))) Source #

Servant API