struct
AI::Provider::LanguageModel::Source
- AI::Provider::LanguageModel::Source
- Struct
- Value
- Object
Overview
A source used to generate the response.
Included Modules
- JSON::Serializable
Defined in:
ai/provider/language_model/types.crConstructors
- .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)
- .new(pull : JSON::PullParser)
- .new(*, __pull_for_json_serializable pull : JSON::PullParser)
- .new_document(*, id : String, media_type : String, title : String, filename : String | Nil = nil, provider_metadata : Shared::ProviderMetadata | Nil = nil) : Source
- .new_url(*, id : String, url : String, title : String | Nil = nil, provider_metadata : Shared::ProviderMetadata | Nil = nil) : Source
Instance Method Summary
-
#filename : String | Nil
Filename (for document sources).
-
#id : String
The ID of the source.
-
#media_type : String | Nil
IANA media type (for document sources).
-
#provider_metadata : Shared::ProviderMetadata | Nil
Provider-specific metadata.
-
#source_type : SourceType
The type of source.
-
#title : String | Nil
Title of the source.
- #type : String
-
#url : String | Nil
URL (for URL sources).