Skip to content

Add reasoning extraction + adapt to v0.4.0-beta.10#14

Merged
kwaa merged 18 commits intomoeru-ai:mainfrom
fr33z00:main
Dec 18, 2025
Merged

Add reasoning extraction + adapt to v0.4.0-beta.10#14
kwaa merged 18 commits intomoeru-ai:mainfrom
fr33z00:main

Conversation

@fr33z00
Copy link
Contributor

@fr33z00 fr33z00 commented Dec 12, 2025

Hello.

Message parts of type reasoning were desperately empty, and I didn't figure out how extract-reasonning could fit. So, I decided to modify the api-call function.

As I needed to work with v0.4.0-beta.10 after an issue I published and you fixed, and xsai-use was still based on v0.3.3, I faced the need to adapt the code to this new version. This led to a more complex PR that would have been necessary by the only change on api-call.

Hoping this work to be useful and of reasonable quality, please consider merging it or using it freely as a basis for a new release of xsai-use.

Regards.

@gemini-code-assist
Copy link

Summary of Changes

Hello @fr33z00, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses two main objectives: enabling the extraction and display of 'reasoning' message content and updating the project's dependencies to v0.4.0-beta.10 of the @xsai libraries. The changes involve integrating new event handling for reasoning parts in the API call utility and adapting existing type definitions and API usages to match the updated library interfaces.

Highlights

  • Reasoning Extraction: Implemented logic within the callApi function to correctly process and display reasoning-delta message parts, which were previously unhandled and empty.
  • Dependency Update: Upgraded all @xsai related packages to v0.4.0-beta.10, ensuring compatibility with the latest library versions and addressing previous issues.
  • API Adaptations: Modified various type definitions and function calls across use-chat.ts, part-parser.ts, and types/ui.ts to align with the breaking changes introduced in v0.4.0-beta.10.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request primarily upgrades all @xsai dependencies (including @xsai/shared-chat, @xsai/stream-text, @xsai/tool, @xsai/utils-reasoning, @xsai/shared, and xsschema) from version 0.3.3 to 0.4.0-beta.10 across the project, as reflected in pnpm-lock.yaml and pnpm-workspace.yaml. Concurrently, the packages/shared/package.json version was updated to 0.0.2-reasoning. The dependency upgrade led to type definition changes in packages/shared/src/part-parser.ts and packages/shared/src/types/ui.ts, where generic Part types were replaced with more specific CommonContentPart and RefusalContentPart types, and ToolMessagePart was replaced by CommonContentPart in UIMessageToolCallPart. In packages/react/src/hooks/use-chat.ts, a property name was changed from signal to abortSignal. A notable functional change in packages/shared/src/utils/call-api.ts introduces handling for a new reasoning-delta event type, allowing the system to process and display reasoning information, and the streamText call was modified to be non-awaiting. No review comments were provided for this pull request.

@kwaa
Copy link
Member

kwaa commented Dec 15, 2025

Other LGTM

@kwaa kwaa requested a review from exoticknight December 15, 2025 07:17
fr33z00 and others added 3 commits December 15, 2025 10:39
Co-authored-by: 藍+85CD <50108258+kwaa@users.noreply.github.com>
Fixed signal -> abortSignal in svelte & vue
@fr33z00
Copy link
Contributor Author

fr33z00 commented Dec 16, 2025

Seing the compilation error in CI, I fixed signal into abortSignal in svelte & vue. The error confirms the name change in react was legit.

@fr33z00
Copy link
Contributor Author

fr33z00 commented Dec 16, 2025

A type error was still there in svelte. This is out of the scope of my PR, but I guess needed for it to be accepted.

@fr33z00
Copy link
Contributor Author

fr33z00 commented Dec 16, 2025

Fix type ordering complain from linter.
I ran lint and build after this one, and it compiles. Should be the last one...

@fr33z00
Copy link
Contributor Author

fr33z00 commented Dec 17, 2025

All good, now, thanks @kwaa for the review.

@kwaa kwaa merged commit 4e0829e into moeru-ai:main Dec 18, 2025
1 check passed
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