updated gitignore and setup PKGBUILD for archlinux packaging
Continuous integration / build (push) Failing after 7m6s
Continuous integration / build (push) Failing after 7m6s
This commit is contained in:
@@ -24,6 +24,7 @@ pub enum ContentAI {
|
||||
result: Arc<Mutex<String>>,
|
||||
ready: Arc<Mutex<ReadyState>>,
|
||||
temperature: f32,
|
||||
reasoning_effort: ReasoningEffort,
|
||||
model_override: String,
|
||||
},
|
||||
}
|
||||
@@ -98,6 +99,7 @@ impl ContentAI {
|
||||
ready,
|
||||
temperature,
|
||||
model_override,
|
||||
reasoning_effort,
|
||||
..
|
||||
} = self
|
||||
{
|
||||
@@ -154,6 +156,26 @@ impl ContentAI {
|
||||
.range(0.0..=2.0)
|
||||
.speed(0.1),
|
||||
);
|
||||
|
||||
ui.label("Reasoning effort");
|
||||
|
||||
egui::ComboBox::from_id_salt("reasoning_effort")
|
||||
.selected_text(reasoning_effort.to_string())
|
||||
.show_ui(ui, |ui| {
|
||||
ui.selectable_value(
|
||||
reasoning_effort,
|
||||
ReasoningEffort::Minimal,
|
||||
"Minimal",
|
||||
);
|
||||
ui.selectable_value(reasoning_effort, ReasoningEffort::Low, "Low");
|
||||
ui.selectable_value(
|
||||
reasoning_effort,
|
||||
ReasoningEffort::Medium,
|
||||
"Medium",
|
||||
);
|
||||
ui.selectable_value(reasoning_effort, ReasoningEffort::High, "High");
|
||||
});
|
||||
|
||||
ui.end_row();
|
||||
|
||||
ui.label("Model override");
|
||||
@@ -175,9 +197,11 @@ impl ContentAI {
|
||||
let ai_context = project.ai_context.clone();
|
||||
let result = result.clone();
|
||||
let ready = ready.clone();
|
||||
let reasoning_effort = reasoning_effort;
|
||||
|
||||
let options = AIOptions {
|
||||
max_completion_tokens: *max_tokens,
|
||||
reasoning_effort: *reasoning_effort,
|
||||
temperature: *temperature,
|
||||
model_override: if !model_override.is_empty() {
|
||||
Some(model_override.clone())
|
||||
@@ -271,10 +295,8 @@ pub fn continue_content(
|
||||
result: Arc<Mutex<String>>,
|
||||
ready: Arc<Mutex<ReadyState>>,
|
||||
) -> Result<(), Box<dyn std::error::Error>> {
|
||||
println!("here");
|
||||
*ready.lock().unwrap() = ReadyState::Generating;
|
||||
|
||||
println!("here2");
|
||||
let client = reqwest::blocking::Client::new();
|
||||
|
||||
let messages = vec![
|
||||
@@ -308,6 +330,7 @@ pub fn continue_content(
|
||||
temperature: options.temperature,
|
||||
max_tokens: options.max_completion_tokens,
|
||||
model: options.model_override,
|
||||
reasoning_effort: options.reasoning_effort,
|
||||
stream: true,
|
||||
};
|
||||
|
||||
@@ -338,6 +361,8 @@ pub fn continue_content(
|
||||
.send()?
|
||||
};
|
||||
|
||||
println!("success!");
|
||||
|
||||
let reader = BufReader::new(response);
|
||||
for line in reader.lines() {
|
||||
// initial loop to check if the user has terminated the generation
|
||||
@@ -376,6 +401,7 @@ pub fn continue_content(
|
||||
pub struct AIOptions {
|
||||
pub max_completion_tokens: usize,
|
||||
pub temperature: f32,
|
||||
pub reasoning_effort: ReasoningEffort,
|
||||
pub model_override: Option<String>,
|
||||
}
|
||||
|
||||
@@ -387,6 +413,35 @@ pub enum ReadyState {
|
||||
Halted,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Copy, Clone, PartialEq)]
|
||||
pub enum ReasoningEffort {
|
||||
#[serde(rename = "minimal")]
|
||||
Minimal,
|
||||
#[serde(rename = "low")]
|
||||
Low,
|
||||
#[serde(rename = "medium")]
|
||||
Medium,
|
||||
#[serde(rename = "high")]
|
||||
High,
|
||||
}
|
||||
|
||||
impl Default for ReasoningEffort {
|
||||
fn default() -> Self {
|
||||
ReasoningEffort::Low
|
||||
}
|
||||
}
|
||||
|
||||
impl ToString for ReasoningEffort {
|
||||
fn to_string(&self) -> String {
|
||||
match self {
|
||||
ReasoningEffort::Minimal => "Minimal".to_string(),
|
||||
ReasoningEffort::Low => "Low".to_string(),
|
||||
ReasoningEffort::Medium => "Medium".to_string(),
|
||||
ReasoningEffort::High => "High".to_string(),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Simple request structure
|
||||
#[derive(Serialize)]
|
||||
struct ChatRequest {
|
||||
@@ -394,6 +449,7 @@ struct ChatRequest {
|
||||
temperature: f32,
|
||||
max_tokens: usize,
|
||||
stream: bool,
|
||||
reasoning_effort: ReasoningEffort,
|
||||
|
||||
// if we give the API model:null it returns 500
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
|
||||
Reference in New Issue
Block a user