Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds native Nim OpenRouter calls to the BASIC hosts in Gods of the Arena, Call to Adventure, and Light vs Dark. The game uses the environment's sidecar when configured, with per-player accounting headers, or direct HTTPS OpenRouter access for local runs. It ships no Python helper or subprocess.
examples/gods_of_the_arena/players/jev.bassends a text match summary and asks JEV for a strategy and lane every 15 simulation seconds. It follows farming, ganking, pushing, defending, or regrouping advice, handles movement and emergency retreats locally, and retains its plan on incomplete or failed replies.Includes BASIC examples, configuration documentation, libcurl packaging, and tests.
tests/manual_jev.nimmakes exactly one paid direct OpenRouter request when explicitly run; it is excluded from CI. Uploaded neural networks remain outside this work.llms.nimcontains the BASIC bindings and calls Curly'sstartRequestandpollForResponsedirectly. Each player has oneLlmClient, one pending request, and the latest completed response string with its HTTP status and error. New responses replace old ones.oracles.nimonly prepares JEV payloads and interprets answers, retaining the latest answer set. Normal text and JEV calls share the same pending-request limit. JSON parsing uses jsony.Each player lazily creates one Curly worker. SSE responses become available after the stream ends. Body/header limits are checked after Curly buffers the response. A host deadline settles the BASIC call and barrier while the seat stays busy until the underlying transfer completes; late replies are discarded. Curly's transport timeout rounds up to whole seconds, and cleanup waits for outstanding transfers. The lockfiles include the request cleanup fix in guzba/curly#28.
The GotA/LvD mailbox example reads a DM, asks an LLM for a reply, and sends it back to the sender using the game's existing mailbox routing.
Validation:
nim check tests/tests.nimand the complete test suite passed.jev.basagainst mock replies for all five strategies, lane changes, stage summaries, periodic refresh, incomplete replies, HTTP failure, and emergency retreat.typesafe/jev-1.13-20260917(TypeSafe), selectingfarmandmid. Usage: 542 input tokens, 90 output tokens, reported cost $0.000022764. This live check preceded the Curly transport change; the current transport is tested with local mocks and the captured response passes BASIC readback offline. No second paid call was made.nim check tests/manual_jev.nimand compilation pass; all automated LLM tests use local mocks or the captured response.jev.basusing its fallback plan.Deployment note: JEV requires the sidecar to expose
/v1/systemone. The inspected local Metta sidecar has Chat Completions and Anthropic routes but no explicit SystemOne route. Direct OpenRouter JEV was verified by the manual request above; the hosted sidecar deployment remains unverified. Raw access is bounded JSON/SSE; multipart uploads and arbitrary custom headers are not exposed.