[genai]
# Required (any model supported by the Rust genai crate)
# e.g., "gpt-4o", "gpt-4o-2024-08-06", "gpt-4o-mini", "claude-3-5-sonnet-20240620"
# Local Ollama: "llama3.1:70b" (or any locally installed Ollama)
model = "gemini-1.5-flash-latest"
[runtime]
# Default to 1 if absent
items_concurrency = 1
Agent
# Data
let path = item.path;
let file = file::load(path);
return #{file: file};
# Instruction
- The user will provide you with the content of a Rust programming file.
- You will correct the English in the comments, but leave everything else unchanged.
- Only modify comments if there is a spelling or grammar mistake.
- Make sure not to change the code, except for typos within strings.
- Do not change the code itself, only comments.
{{data.file.content}}
# Output
let rust_blocks = md::extract_blocks(ai_output, "rust");
let first_rust_block = rust_blocks[0].content;
let rust_code = text::escape_decode_if_needed(first_rust_block);
file::save(data.file.path, rust_code);
// This will be printed
return "File processed: " + data.file.path
@PierrickGT This is a good bug. I will investigate. It seems Gemini may require at least one user message. I will address that and, in the case of Gemini, set the instruction as the user message.
Bug description
When running the
proof-comments
command using Gemini, I encounter the following issue.It looks like
{{data.file.content}}
is not being parsed and passed to the API call.Command
GEMINI_API_KEY="API_KEY" devai run proof-comments -f "./src/*.rs"
Error
Error: GenAI(WebModelCall { model_iden: ModelIden { adapter_kind: Gemini, model_name: ModelName("gemini-1.5-flash-latest") }, webc_error: ResponseFailedStatus { status: 400, body: "{\n \"error\": {\n \"code\": 400,\n \"message\": \"* GenerateContentRequest.contents: contents is not specified\\n\",\n \"status\": \"INVALID_ARGUMENT\"\n }\n}\n" } })
Config
Agent
Verbose output