com.alecdorrington.iris

Members list

Type members

Classlikes

object Conversation

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
final case class Conversation(messages: List[Message] = ..., instructions: Option[String] = ...)

The full history of a conversation with a model, sent whole with every request. To go on with a conversation, append the model's response and the user's next message, then send the conversation again:

The full history of a conversation with a model, sent whole with every request. To go on with a conversation, append the model's response and the user's next message, then send the conversation again:

for
 first  <- query.send[String](conversation)
 asked  <- first.attempts
 next    = conversation.modelSays(asked.last).userSays("Tell me more.")
 second <- query.send[String](next)
yield second.value

Asked of a conversation ending with the model's message, the model is told what to answer in a message of the user's after it, and so answers afresh rather than going on with its own response. A conversation with no messages, a message of breakpoints alone, or no message of the user's fails with PromptError.Unsendable before any request is made.

Value parameters

instructions

The instructions, if any, setting the model's general behaviour, sent as the provider's system message.

messages

The messages exchanged so far, oldest first.

Attributes

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

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
MediaType.type
sealed trait MediaType

The kind of a picture, document or other media in a MessagePart.Media, by its IANA media type. The kinds Iris lists are constants (MediaType.Png), so that a provider refuses one it cannot take before any request is spent finding out; any other is an MediaType.Other, sent only to Gemini, which takes audio and video as well, and judges for itself.

The kind of a picture, document or other media in a MessagePart.Media, by its IANA media type. The kinds Iris lists are constants (MediaType.Png), so that a provider refuses one it cannot take before any request is spent finding out; any other is an MediaType.Other, sent only to Gemini, which takes audio and video as well, and judges for itself.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
enum Listed
class Other
object Message

Attributes

Companion
enum
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
Message.type
enum Message

A single message in a Conversation, one case for each of its owners, holding only the parts that owner writes.

A single message in a Conversation, one case for each of its owners, holding only the parts that owner writes.

Attributes

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

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
sealed trait MessagePart

A part of a message. A message is a list of parts, so that text and media travel together in reading order. Each owner of a message writes parts of its own kinds: UserParts, ModelParts and ToolParts.

A part of a message. A message is a list of parts, so that text and media travel together in reading order. Each owner of a message writes parts of its own kinds: UserParts, ModelParts and ToolParts.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
Known subtypes
trait ModelPart
class Text
class ToolCall
trait ToolPart
class ToolResult
trait UserPart
class Media
Show all
sealed trait ModelPart extends MessagePart

A part of a message of the model's: text, a tool call or a breakpoint.

A part of a message of the model's: text, a tool call or a breakpoint.

Attributes

Companion
object
Supertypes
trait MessagePart
class Object
trait Matchable
class Any
Known subtypes
class Text
class ToolCall
object ModelPart

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
ModelPart.type
final case class Rates(uncached: Usd, cacheRead: Usd, cacheWrite: Usd, uncachedAudio: Usd, cacheReadAudio: Usd, visible: Usd, thinking: Usd, above: Option[Above] = ...)

What a model's tokens cost, in Usd per million tokens, with one rate for each of Usage's counts, as its provider charges on its standard tier. A count the provider charges nothing apart for is charged as the rest of its kind: cache writes as input where writing the cache costs nothing more, audio as other input where it is priced alike, and thinking as the reply.

What a model's tokens cost, in Usd per million tokens, with one rate for each of Usage's counts, as its provider charges on its standard tier. A count the provider charges nothing apart for is charged as the rest of its kind: cache writes as input where writing the cache costs nothing more, audio as other input where it is priced alike, and thinking as the reply.

Value parameters

above

The rates instead of these for a request whose prompt is longer, where the provider charges more for a long prompt.

cacheRead

The rate of tokens of the request read from the cache, other than audio.

cacheReadAudio

The rate of tokens of audio read from the cache.

cacheWrite

The rate of tokens of the request written to the cache.

thinking

The rate of tokens the model thought in.

uncached

The rate of tokens of the request read afresh, other than audio.

uncachedAudio

The rate of tokens of audio read afresh.

visible

The rate of tokens the model replied with.

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Rates.type
sealed trait ToolPart extends MessagePart

A part of a message of the tools': a tool's result or a breakpoint.

A part of a message of the tools': a tool's result or a breakpoint.

Attributes

Supertypes
trait MessagePart
class Object
trait Matchable
class Any
Known subtypes
final case class Usage(uncachedTokens: Int = ..., cacheReadTokens: Int = ..., cacheWriteTokens: Int = ..., uncachedAudioTokens: Int = ..., cacheReadAudioTokens: Int = ..., visibleTokens: Int = ..., thinkingTokens: Int = ...)

The token counts of one request or more, as the provider reported them, alike for every provider. No count includes another, so that each may be priced alone. A count the provider did not report is 0, as is one it never charges for apart: Gemini charges nothing for writing its cache, nor OpenAI before GPT-5.6, and only Gemini reports audio apart.

The token counts of one request or more, as the provider reported them, alike for every provider. No count includes another, so that each may be priced alone. A count the provider did not report is 0, as is one it never charges for apart: Gemini charges nothing for writing its cache, nor OpenAI before GPT-5.6, and only Gemini reports audio apart.

Value parameters

cacheReadAudioTokens

The number of tokens of audio in the request read from the provider's cache.

cacheReadTokens

The number of tokens of the request read from the provider's cache, other than audio.

cacheWriteTokens

The number of tokens of the request written to the provider's cache, where the provider charges for writing them.

thinkingTokens

The number of tokens the model thought in before it replied, whether or not the provider shows what it thought.

uncachedAudioTokens

The number of tokens of audio in the request read afresh.

uncachedTokens

The number of tokens of the request read afresh, other than audio.

visibleTokens

The number of tokens the model replied with: its text and tool calls.

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class Object
trait Matchable
class Any
Show all
final case class Usd(amount: BigDecimal)

An amount of US dollars, the currency every provider prices in. Iris converts it to no other: a host billed in another currency converts it at its own rate, which the one billing it sets. Nor does it count tax, credits or a discount of one's own.

An amount of US dollars, the currency every provider prices in. Iris converts it to no other: a host billed in another currency converts it at its own rate, which the one billing it sets. Nor does it count tax, credits or a discount of one's own.

Value parameters

amount

The number of dollars.

Attributes

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

Attributes

Companion
class
Supertypes
trait Product
trait Mirror
class Object
trait Matchable
class Any
Self type
Usd.type
sealed trait UserPart extends MessagePart

A part of a message of the user's: text, media or a cache breakpoint.

A part of a message of the user's: text, media or a cache breakpoint.

Attributes

Companion
object
Supertypes
trait MessagePart
class Object
trait Matchable
class Any
Known subtypes
class Media
class Text
object UserPart

Attributes

Companion
trait
Supertypes
trait Sum
trait Mirror
class Object
trait Matchable
class Any
Self type
UserPart.type