The Interface to interact with large language models.
Methods
Creates a new Llm connection.
Example
let llm = new
.temperature
.system_msg;
let res = llm.send .await?;
assert!;
Clones the LLM and returns a new independet one.
Example
let llm0 = new;
let llm1 = llm0.clone;
assert_eq!;
llm1.temperature = 0.25;
assert_ne!;
Set the temperature for the LLM. The higher the value the more creative the LLM will answer your requests. This functions consumes the LLM and returns it updated.
Example
let llm = new .temperature;
assert_eq!;
Set the model to use.. This functions consumes the Llm and returns it updated.
Example
let llm = new .model;
assert_eq!;
Set the system message of the chat conversation. This functions consumes the Llm and returns it updated.
Example
let llm = new .system_msg;
assert_eq!;
Sends a message to the Ai and returns the answer. It also attaches the question and reponse to the actual chat conversation. This allows for a complete conversation to happen.
Example
let llm = new .system_msg;
let res = llm.chat .await?;
assert!;
Sends a message to the Ai and returns the answer. It's not attaching the question or answer to the conversation. This allows to ask another question towards the same context as before.
Example
let llm = new
.model
.system_msg;
//let res = llm.send("Hello").await?;
//assert!(res is String);
Protocols
let output = value.system_msg
Get the system message of the chat conversation.
Example
let llm = new;
llm.system_msg = "You are a helpfull assistant:";
assert_eq!;
value.system_msg = input
Set the system message of the chat conversation.
Example
let llm = new;
llm.system_msg = "You are a helpfull assistant:";
assert_eq!;