struct AI::Provider::LanguageModel::Source

Overview

A source used to generate the response.

Included Modules

Defined in:

ai/provider/language_model/types.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(source_type : SourceType, id : String, url : String | Nil = nil, media_type : String | Nil = nil, title : String | Nil = nil, filename : String | Nil = nil, provider_metadata : Shared::ProviderMetadata | Nil = nil) #

[View source]
def self.new(pull : JSON::PullParser) #

[View source]
def self.new(*, __pull_for_json_serializable pull : JSON::PullParser) #

[View source]
def self.new_document(*, id : String, media_type : String, title : String, filename : String | Nil = nil, provider_metadata : Shared::ProviderMetadata | Nil = nil) : Source #

[View source]
def self.new_url(*, id : String, url : String, title : String | Nil = nil, provider_metadata : Shared::ProviderMetadata | Nil = nil) : Source #

[View source]

Instance Method Detail

def filename : String | Nil #

Filename (for document sources).


[View source]
def id : String #

The ID of the source.


[View source]
def media_type : String | Nil #

IANA media type (for document sources).


[View source]
def provider_metadata : Shared::ProviderMetadata | Nil #

Provider-specific metadata.


[View source]
def source_type : SourceType #

The type of source.


[View source]
def title : String | Nil #

Title of the source.


[View source]
def type : String #

[View source]
def url : String | Nil #

URL (for URL sources).


[View source]