APIQIKAPIQIK
Docs
Cookbook

Coding Assistant

Provide clear context and verifiable feedback for code generation, explanation, refactoring, and repair.

Good coding tasks specify language versions, existing interfaces, allowed changes, and validation criteria rather than simply asking the model to fix something.

Prompt template

{
  "model": "deepseek-chat",
  "messages": [
    {
      "role": "system",
      "content": "You are a code review assistant. Report only reproducible problems, ordered by severity, with minimal fixes."
    },
    {
      "role": "user",
      "content": "Runtime: Python 3.12\nGoal: Check concurrency safety and error handling in the function below.\nConstraint: Do not change the public signature.\nCode:\n<insert code here>"
    }
  ],
  "temperature": 0.2,
  "max_tokens": 1200
}

Provide useful context

  • Language, framework, dependency versions, and runtime environment.
  • Expected behavior, actual behavior, complete errors, and minimal reproduction steps.
  • Relevant functions, types, and callers, not the entire unrelated repository.
  • Files that may change and public interfaces that must remain stable.
  • Existing tests and expected additional test cases.

Use deterministic validation

After generation, run formatting, type checks, static analysis, and tests. The model can explain failures and propose fixes but cannot replace objective tool results.

Model proposes changes → formatting, compilation, static checks, and tests → human review and safe rollout.

Never execute untrusted code directly. Run generated code in an isolated environment with restricted network, filesystem, and credential access. Database migrations, infrastructure changes, and production commands require human review.