class Turquoise::Eloquent
- Turquoise::Eloquent
- Reference
- Object
Defined in:
turquoise/eloquent.crturquoise/eloquent/extra.cr
turquoise/eloquent/messages.cr
Constant Summary
-
MAX_MESSAGES =
10
-
MODEL_CONFIG =
{model_name: ENV["ELOQUENT_MODEL"], generation_config: Gemini::GenerationConfig.new(max_output_tokens: 128), safety_settings: [Gemini::SafetySetting.new(:HarmCategorySexuallyExplicit, :BlockNone), Gemini::SafetySetting.new(:HarmCategoryHateSpeech, :BlockNone), Gemini::SafetySetting.new(:HarmCategoryHarassment, :BlockNone), Gemini::SafetySetting.new(:HarmCategoryDangerousContent, :BlockNone), Gemini::SafetySetting.new(:HarmCategoryCivicIntegrity, :BlockNone)], tools: [Gemini::Tool.new([Gemini::FunctionDeclaration.new("send_selfie_image", description: "Send a selfie. Call this when you need to send a photo of yourself."), Gemini::FunctionDeclaration.new("send_custom_image", description: "Send an image using AI. Call this when you need to create a custom image, for example when they ask for 'Create an image of a dog'.", parameters: Gemini::Schema.new(type: :object, properties: {"prompt" => Gemini::Schema.new(type: :string, description: "Description of the image you want to generate. Translated to English."), "num_steps" => Gemini::Schema.new(type: :integer, description: "Image quality from 1 to 8. 1 is low quality, 8 is high, default is 4.")}, required: ["prompt"]))])]}
Constructors
Instance Method Summary
- #chat : Models::Chat
- #function_calling_handler(response : Pointer(Gemini::GenerateContentResponse))
- #generate(text : String) : String
-
#media : Array(Tourmaline::InputMediaPhoto)
Send media using telegram API
-
#media_captions? : Bool
Check if
#media
has captions - #messages : Messages
- #random_selfie : String
- #send_custom_image(func_call : Gemini::FunctionCall) : Gemini::Part
- #send_selfie_image(func_call : Gemini::FunctionCall) : Gemini::Part
-
#system_role
TODO internationalization