io.github.quafadas.dairect

Members list

Type members

Experimental classlikes

case class Agent[Alg[_[_, _, _, _, _]]](model: ChatGpt, seedMessages: List[AiMessage], modelParams: ChatGptConfig, toolkit: FunctorAlgebra[Alg, IO], service: Service[Alg], name: String)

Attributes

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

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Agent.type

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
case class AiResponseFormat(`type`: AiResponseFormatString, json_schema: Option[Document])

Attributes

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

Attributes

Experimental
true
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait AssistantApi

https://platform.openai.com/docs/api-reference/assistants/createAssistant

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object AssistantApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
case class AssistantFileSearch(max_num_results: Option[Int])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object AssistantMetaData extends Newtype[Map[String, String]]

Attributes

Experimental
true
Supertypes
class Newtype[Map[String, String]]
class AbstractNewtype[Map[String, String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type

Attributes

Experimental
true
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class AssistantToolFunction(name: String, parameters: Option[Document], description: Option[String], strict: Option[Boolean])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ChatChunk(id: String, choices: List[ChunkChoice], created: Long, model: String, service_tier: Option[String], system_fingerprint: String, `object`: String, usage: Option[AiTokenUsage])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait ChatGpt

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object ChatGpt

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
ChatGpt.type
case class ChunkChoice(delta: ChunkDelta, finish_reason: Option[String], index: Int)

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ChunkDelta(content: Option[String], tool_calls: Option[List[ToolCall]], role: Option[String], refusal: Option[String])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class CodeInterpreter(file_ids: CodeInterpreterFileIds)

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object CodeInterpreterFileIds extends Newtype[List[String]]

Attributes

Experimental
true
Supertypes
class Newtype[List[String]]
class AbstractNewtype[List[String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
case class Compounds(strings: List[String], mapy: Map[String, String])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Democracy

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
Democracy.type

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object EmbeddingsApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
object FileIds extends Newtype[List[String]]

Attributes

Experimental
true
Supertypes
class Newtype[List[String]]
class AbstractNewtype[List[String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
FileIds.type
case class FileSearch(vector_store_ids: Option[VectorStoreIds], vector_stores: Option[VectorStoreIds])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait FilesApi

https://platform.openai.com/docs/api-reference/files

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object FilesApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
FilesApi.type
case class FunctionCall(name: String, description: Option[String], arguments: Option[String])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class ImageDetails(file_id: String, detail: Option[String])

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ImageDetails extends Companion[ImageDetails]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[ImageDetails]
trait Has[ImageDetails]
trait ShapeTag[ImageDetails]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
final case class ImageFile(image_file: ImageDetails)

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ImageFile extends Companion[ImageFile]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[ImageFile]
trait Has[ImageFile]
trait ShapeTag[ImageFile]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
ImageFile.type
final case class ImageUrl(image_url: ImageUrlDetails)

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ImageUrl extends Companion[ImageUrl]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[ImageUrl]
trait Has[ImageUrl]
trait ShapeTag[ImageUrl]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
ImageUrl.type
final case class ImageUrlDetails(url: String, detail: Option[String])

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ImageUrlDetails extends Companion[ImageUrlDetails]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[ImageUrlDetails]
trait Has[ImageUrlDetails]
trait ShapeTag[ImageUrlDetails]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
sealed trait MessageContent extends Product, Serializable

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type
object MessageContent extends Companion[MessageContent]

Attributes

Companion
trait
Experimental
true
Supertypes
trait Sum
trait Mirror
trait Companion[MessageContent]
trait Has[MessageContent]
trait ShapeTag[MessageContent]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
object MessageContentList extends Newtype[List[MessageContent]]

Attributes

Experimental
true
Supertypes
class Newtype[List[MessageContent]]
class AbstractNewtype[List[MessageContent]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
object MessageMetaData extends Newtype[Map[String, String]]

Attributes

Experimental
true
Supertypes
class Newtype[Map[String, String]]
class AbstractNewtype[Map[String, String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
sealed trait MessageOnThread extends Product, Serializable

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
class ArrayCase
class StrCase
Self type
object MessageOnThread extends Companion[MessageOnThread]

Attributes

Companion
trait
Experimental
true
Supertypes
trait Sum
trait Mirror
trait Companion[MessageOnThread]
trait Has[MessageOnThread]
trait ShapeTag[MessageOnThread]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
sealed trait MessageToSend extends Product, Serializable

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
Known subtypes
Self type
object MessageToSend extends Companion[MessageToSend]

Attributes

Companion
trait
Experimental
true
Supertypes
trait Sum
trait Mirror
trait Companion[MessageToSend]
trait Has[MessageToSend]
trait ShapeTag[MessageToSend]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
object MessageToSendList extends Newtype[List[MessageToSend]]

Attributes

Experimental
true
Supertypes
class Newtype[List[MessageToSend]]
class AbstractNewtype[List[MessageToSend]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
trait MessagesApi

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object MessagesApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
trait OsTool

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any

Attributes

Experimental
true
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object RunMetaData extends Newtype[Map[String, String]]

Attributes

Experimental
true
Supertypes
class Newtype[Map[String, String]]
class AbstractNewtype[Map[String, String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
trait RunStepsApi

https://platform.openai.com/docs/api-reference/run-steps/getRunStep

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object RunStepsApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
trait RunsApi

https://platform.openai.com/docs/api-reference/run-steps/getRunStep

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object RunsApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
RunsApi.type
trait Serp

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object Serp

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
Serp.type
class SmithyOpenAIUtil[F[_]](implicit F: MonadThrow[F])

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
case class StructuredOutput(name: String, description: Option[String], schema: Option[Document], strict: Option[Boolean])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Text(text: TextValue)

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object Text extends Companion[Text]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[Text]
trait Has[Text]
trait ShapeTag[Text]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
Text.type
final case class TextToSend(text: String)

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TextToSend extends Companion[TextToSend]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[TextToSend]
trait Has[TextToSend]
trait ShapeTag[TextToSend]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
TextToSend.type
final case class TextValue(value: Option[String])

Attributes

Companion
object
Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object TextValue extends Companion[TextValue]

Attributes

Companion
class
Experimental
true
Supertypes
trait Product
trait Mirror
trait Companion[TextValue]
trait Has[TextValue]
trait ShapeTag[TextValue]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
TextValue.type
trait ThreadApi

https://platform.openai.com/docs/api-reference/assistants/createAssistant

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object ThreadApi

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
ThreadApi.type
case class ThreadMessage(content: MessageOnThread, role: ThreadMessageRole, attachments: Option[List[MessageAttachment]], metadata: Option[ThreadMetaData])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all

Attributes

Experimental
true
Supertypes
trait Enum
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
object ThreadMetaData extends Newtype[Map[String, String]]

Attributes

Experimental
true
Supertypes
class Newtype[Map[String, String]]
class AbstractNewtype[Map[String, String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
case class ToolCall(id: String, `type`: String, function: FunctionCall)

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
case class ToolResources(code_interpreter: Option[CodeInterpreter], file_search: Option[FileSearch])

Attributes

Experimental
true
Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
trait UrlReader

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any
object UrlReader

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
UrlReader.type

https://platform.openai.com/docs/api-reference/vector-stores

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
object VectorStoreFileIds extends Newtype[List[String]]

Attributes

Experimental
true
Supertypes
class Newtype[List[String]]
class AbstractNewtype[List[String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type

https://platform.openai.com/docs/api-reference/vector-stores-files

Attributes

Companion
object
Experimental
true
Supertypes
class Object
trait Matchable
class Any

Attributes

Companion
trait
Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type
object VectorStoreIds extends Newtype[List[String]]

Attributes

Experimental
true
Supertypes
class Newtype[List[String]]
class AbstractNewtype[List[String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type
object VectorStoreMetaData extends Newtype[Map[String, String]]

Attributes

Experimental
true
Supertypes
class Newtype[Map[String, String]]
class AbstractNewtype[Map[String, String]]
trait HasId
class Object
trait Matchable
class Any
Show all
Self type

Attributes

Experimental
true
Supertypes
class Object
trait Matchable
class Any
Self type

Types

type AssistantMetaData = Type
type FileIds = Type
type MessageContentList = Type
type MessageMetaData = Type
type MessageToSendList = Type
type RunMetaData = Type
type ThreadMetaData = Type
type VectorStoreFileIds = Type
type VectorStoreIds = Type
type VectorStoreMetaData = Type

Value members

Experimental methods

def assistWare: () => IO

Attributes

Experimental
true
def authMiddleware(tokResource: Resource[IO, String]): () => IO

Attributes

Experimental
true
def fileLogger(toFile: Path): Client[IO] => Client[IO]

Attributes

Experimental
true
def makeLogFile(toFile: Path): IO[Unit]

Attributes

Experimental
true
def serpWare(tokResource: Resource[IO, String]): () => IO

Attributes

Experimental
true
def serpware: Client[IO] => Client[IO]

Attributes

Experimental
true

Experimental fields

val filesIo: Files[IO]

Attributes

Experimental
true

These are toy interpreters that turn services into json-in/json-out functions, and vice versa.

These are toy interpreters that turn services into json-in/json-out functions, and vice versa.

Created for testing purposes.

Attributes

Experimental
true
val printLogger: Client[IO] => Client[IO]

Attributes

Experimental
true

Extensions

Experimental extensions

extension [A](a: IO[A])
inline def Ø: A

If we have a service which returns an IO (i.e. plugs into the cats effect infrastructure)

If we have a service which returns an IO (i.e. plugs into the cats effect infrastructure)

let's make it simple to drive in a repl...

Attributes

Experimental
true
extension [A](a: A)
inline def some: Option[A]

Attributes

Experimental
true
extension [Alg[_[_, _, _, _, _]]](agent: Agent[Alg])
inline def startAgent: IO[List[AiMessage]]

Attributes

Experimental
true
def systemMessage(msg: String): SystemMessage

Attributes

Experimental
true
def userMessage(msg: String): AiMessage

Attributes

Experimental
true
extension (c: ChatGpt)
def stream(messages: List[AiMessage], model: String, temperature: Option[Double], tools: Option[Document], response_format: Option[AiResponseFormat], authdClient: Resource[IO, Client[IO]], baseUrl: String): Stream[IO, String]

Attributes

Experimental
true
def streamRaw(messages: List[AiMessage], model: String, temperature: Option[Double], tools: Option[Document], response_format: Option[AiResponseFormat], authdClient: Resource[IO, Client[IO]], baseUrl: String): Stream[IO, List[ChatChunk]]

Attributes

Experimental
true
extension (fApi: FilesApi)
def content[F[_] : Files](file: Path, authdClient: Resource[IO, Client[IO]], file_id: String): Nothing

Attributes

Experimental
true
def upload[F[_] : Files](file: Path, authdClient: Resource[IO, Client[IO]], purpose: String, baseUrl: String): IO[IO[Nothing] | File]

Attributes

Experimental
true
extension (s: String)
def msg: StrCase

https://platform.openai.com/docs/api-reference/assistants/createAssistant