class Turquoise::Eloquent

Defined in:

turquoise/eloquent.cr
turquoise/eloquent/api.cr

Constant Summary

ENDPOINT = "https://api.cloudflare.com/client/v4/accounts/#{ENV["ELOQUENT_ACCOUNT_ID"]}/ai/run/"
HEADERS = HTTP::Headers {"Authorization" => "Bearer #{ENV["ELOQUENT_API_KEY"]}", "Content-Type" => "application/json"}
MAX_MESSAGES = 6
MAX_TOKENS = nil
MODEL = {text_generation: "@hf/nousresearch/hermes-2-pro-mistral-7b", text_to_image: "@cf/stabilityai/stable-diffusion-xl-base-1.0"}

Constructors

Instance Method Summary

Constructor Detail

def self.new(chat_id) #

[View source]

Instance Method Detail

def chat : Models::Chat #

[View source]
def clear #

Reset chat messages.


[View source]
def completion(text : String) : Chat::Completion::Message #

[View source]
def data : Chat::Request #

[View source]
def data=(data : Chat::Request) #

[View source]
def random_selfie #

[View source]
def send_custom_image(tool_call : Chat::Tool::Call, message : Pointer(Chat::Completion::Message)) #

[View source]
def send_selfie_image(tool_call : Chat::Tool::Call, message : Pointer(Chat::Completion::Message)) #

[View source]
def system_role #

TODO internationalization


[View source]