evoproc_procedures.ollama¶
Ollama-backed query helpers for structured procedure generation and repair.
- These functions implement the QueryFn/RepairFn style expected by the GA core:
query(…): general-purpose text → JSON call, optionally constrained by a JSON Schema.
hard_query(…): strict/low-temperature variant useful for repair passes.
query_repair_structured(…): loop that validates a procedure JSON and issues
minimal repair prompts until it passes (or exhausts retries). - create_and_validate_procedure_structured(…): one-shot convenience that creates a procedure JSON for a task and validates/repairs it before returning.
All functions are pure client wrappers around ollama.generate. They return strings (for raw model responses) or dicts (for JSON payloads).
Functions
|
Convenience creator that uses Ollama under the hood. |
|
Call Ollama with strict decoding settings. |
|
General-purpose Ollama call. |
|
Adapter for GA's repair_fn(proc, model) using Ollama backend. |
|
Ollama-backed 'create → repair → execute' helper for one question. |
- evoproc_procedures.ollama.query(prompt, model, fmt=None, seed=1234)[source]¶
General-purpose Ollama call.
This is your default structured call. When fmt is supplied, Ollama will attempt to return an object matching that schema.
- Parameters:
- Return type:
- Returns:
Raw string response (often JSON text when fmt is provided).
- evoproc_procedures.ollama.hard_query(prompt, model, fmt=None, seed=1234)[source]¶
Call Ollama with strict decoding settings.
Use this when you need the model to adhere tightly to fmt (a JSON Schema), e.g., repair steps. Temperature is set to 0.
- Parameters:
- Return type:
- Returns:
The raw string response (usually JSON text when fmt is provided).
- evoproc_procedures.ollama.repair_fn_ollama(proc, model)[source]¶
Adapter for GA’s repair_fn(proc, model) using Ollama backend.
- evoproc_procedures.ollama.create_and_validate_procedure_ollama(idx, task, *, model, seed=1234, print_diagnostics=False)[source]¶
Convenience creator that uses Ollama under the hood.
- evoproc_procedures.ollama.run_full_procedure_ollama(idx, question, *, model='gemma3:latest', answer_schema_name='gsm', run_steps_fn=None, seed=1234, print_diagnostics=False)[source]¶
Ollama-backed ‘create → repair → execute’ helper for one question.
Args mirror the backend-agnostic version; this just wires in the Ollama query and fetches the answer schema by name.