Skip to content

Conversation

@esafak
Copy link
Owner

@esafak esafak commented Jul 30, 2025

  • Implemented fromOpenAI procedure to parse OpenAI API responses.
  • Added fromOpenRouter procedure for parsing OpenRouter API responses.
  • Modified OpenAIRouter and OpenRouter providers to use their respective
    parsing procedures.
  • Updated tests for OpenAI and OpenRouter providers to include the
    "role" field in mock responses.
  • Removed unnecessary fields from OpenRouter requests.
  • Removed jsony from seance.nimble and nimble.lock.
  • Replaced jsony serialization/deserialization with Nim's built-in json
    and std/options for all providers.
  • Updated openai.nim to use $(%*request) for serialization and
    to(parseJson(responseBodyContent), ChatResponse) for deserialization.
  • Updated openrouter.nim to use $(%*request) for serialization and
    to(parseJson(responseBodyContent), ChatResponse) for deserialization.
  • Updated anthropic.nim to use $(%*request) for serialization and
    a custom fromAnthropic proc for deserialization.
  • Updated gemini.nim to use $(%*request) for serialization and
    a custom fromGemini proc for deserialization.
  • Implemented --schema flag for enforcing JSON output structure.
  • Updated README with examples for using JSON schema.
  • Modified provider interfaces to accept schema, enabling structured responses.
  • Added schema parameter to chat methods across providers.
  • Integrated schema parsing and validation within provider logic.
  • Updated tests to verify schema enforcement.

google-labs-jules bot and others added 4 commits July 29, 2025 21:24
* Implement `--schema` flag for enforcing JSON output structure.
* Update README with examples for using JSON schema.
* Modify provider interfaces to accept schema, enabling structured responses.
* Add `schema` parameter to `chat` methods across providers.
* Integrate schema parsing and validation within provider logic.
* Update tests to verify schema enforcement.
* Remove `jsony` from `seance.nimble` and `nimble.lock`.
* Replace `jsony` serialization/deserialization with Nim's built-in `json`
  and `std/options` for all providers.
* Update `openai.nim` to use `$(%*request)` for serialization and
  `to(parseJson(responseBodyContent), ChatResponse)` for deserialization.
* Update `openrouter.nim` to use `$(%*request)` for serialization and
  `to(parseJson(responseBodyContent), ChatResponse)` for deserialization.
* Update `anthropic.nim` to use `$(%*request)` for serialization and
  a custom `fromAnthropic` proc for deserialization.
* Update `gemini.nim` to use `$(%*request)` for serialization and
  a custom `fromGemini` proc for deserialization.
* Implemented `fromOpenAI` procedure to parse OpenAI API responses.
* Added `fromOpenRouter` procedure for parsing OpenRouter API responses.
* Modified `OpenAIRouter` and `OpenRouter` providers to use their respective
  parsing procedures.
* Updated tests for `OpenAI` and `OpenRouter` providers to include the
  "role" field in mock responses.
* Removed unnecessary fields from OpenRouter requests.
* Refactor ProviderConfig to use Option[string] for model.
* Update default models for Anthropic and OpenRouter.
* Adjust tests for OpenAI, Gemini, and OpenRouter providers to use Option[string].
* Simplify getFinalModel logic in common.nim.
* Add json_schema to OpenRouter provider.
* Update version to 0.4.0.
* Include options module in config.nim and t_config_loading.nim.
@esafak esafak merged commit ac9af82 into main Jul 30, 2025
1 check passed
@esafak esafak deleted the json_schema branch July 30, 2025 04:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants