nikivdev/code · error
Prompt is empty.
Error message
Prompt is empty.
What it means
Error "Prompt is empty." thrown in nikivdev/code.
Source
Thrown at src/ai_server.rs:71
id: String,
}
struct AiServerConfig {
base_url: String,
model: String,
token: Option<String>,
}
/// Send a prompt to the AI server and return a response.
pub fn quick_prompt(
prompt: &str,
model: Option<&str>,
url: Option<&str>,
token: Option<&str>,
) -> Result<String> {
let prompt = prompt.trim();
if prompt.is_empty() {
bail!("Prompt is empty.");
}
let cfg = resolve_ai_config(model, url, token)?;
let client = Client::builder()
.timeout(Duration::from_secs(30))
.build()
.context("failed to create HTTP client")?;
let endpoint = format!("{}/v1/chat/completions", cfg.base_url);
let body = ChatRequest {
model: cfg.model,
messages: vec![ChatMessage {
role: "user".to_string(),
content: prompt.to_string(),
}],
temperature: 0.1,View on GitHub (pinned to a747e741ae)
When it happens
Trigger: Thrown at src/ai_server.rs:71 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of nikivdev/code@a747e741ae (2026-09-01).
Data as JSON: /api/errors/12e778d6afbb4a49.
Report an issue: GitHub.