minor changes
Continuous integration / build (push) Failing after 6m40s

This commit is contained in:
2025-07-27 23:23:47 +01:00
parent bc71a30bfa
commit 4d0e0c90a7
8 changed files with 42 additions and 31 deletions
+10 -2
View File
@@ -1,10 +1,13 @@
use serde::{Deserialize, Serialize};
use crate::editors::context_editor::ProjectContext;
pub fn continue_content(
context: &str,
previous_content: &str,
instruction: &str,
_max_tokens: usize,
max_tokens: usize,
project: &ProjectContext,
) -> Result<String, Box<dyn std::error::Error>> {
let client = reqwest::blocking::Client::new();
@@ -35,10 +38,12 @@ pub fn continue_content(
let request = ChatRequest {
messages,
temperature: 0.7,
max_tokens,
stream: false,
};
let response = client
.post("http://localhost:1234/v1/chat/completions")
.post(project.llm_api_uri.clone() + "/v1/chat/completions")
.json(&request)
.send()?;
@@ -54,11 +59,14 @@ pub fn continue_content(
Err("No response from model".into())
}
}
// Simple request structure
#[derive(Serialize)]
struct ChatRequest {
messages: Vec<Message>,
temperature: f32,
max_tokens: usize,
stream: bool,
}
#[derive(Serialize, Deserialize, Debug)]