struct OpenRouter::Response

Overview

Represents a response from

Defined in:

openrouter/types/response.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(json : JSON::Any) #

[View source]

Instance Method Detail

def choices : Array(Choice) #

[View source]
def created : Int32 #

[View source]
def id : String #

[View source]
def model : String #

[View source]
def to_json(io : IO) #

[View source]
def to_json(json : JSON::Builder) #

[View source]
def usage : Usage | Nil #

Usage data is always returned for non-streaming. When streaming, you will get one usage object at the end accompanied by an empty choices array.


[View source]