Expand description
Minimal client of the OpenAI-compatible agent-mode endpoint of Formal AI
(POST /api/openai/v1/chat/completions), used by --use-formal-ai
(issue #255). Mirrors js/src/lib/formal-ai-client.js. Only the bash
function tool is offered: Formal AI picks the command, start decides
whether and how it runs.
The runtime is always a loopback http:// server, so a small blocking
HTTP/1.1 client over std::net is enough; it polls for cancellation and
the time budget while it waits.
Structs§
- Client
Error - A failed exchange with Formal AI and the exit status it maps to.
- Completion
- One chat completion, normalized for the task loop.
- Http
Client - Client bound to one runtime over HTTP.
- Tool
Call - One tool call Formal AI asked for.
Enums§
- Http
Error - Why an HTTP exchange failed.
Constants§
Traits§
- Completion
Client - Something that answers chat completions (HTTP, or a replay in tests).
Functions§
- bash_
tool - The only tool offered to Formal AI.
- http_
request - One blocking HTTP/1.1 exchange with
Connection: close. - parse_
completion - Normalize one chat completion into what the loop needs.
- parse_
http_ url - Host, port and path prefix of an
http://host:port/prefixURL.