Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gaspar/add pnpm auth token pass data react #1392

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/weak-students-tease.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'ai': patch
---

Pass 'data' on on react/use-chat
5 changes: 5 additions & 0 deletions .github/workflows/release-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,11 @@ jobs:
with:
node-version: 18.x

- name: Add npm auth token to pnpm
run: pnpm config set '//registry.npmjs.org/:_authToken' "${NPM_TOKEN_ELEVATED}"
env:
NPM_TOKEN_ELEVATED: ${{secrets.NPM_TOKEN_ELEVATED}}

- name: Install Dependencies
run: pnpm i

Expand Down
11 changes: 10 additions & 1 deletion packages/core/react/use-chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,20 @@
const constructedMessagesPayload = sendExtraMessageFields
? chatRequest.messages
: chatRequest.messages.map(
({ role, content, name, function_call, tool_calls, tool_call_id }) => ({
({
role,
content,
data,
name,
function_call,
tool_calls,
tool_call_id,
}) => ({
role,
content,
tool_call_id,
...(name !== undefined && { name }),
...(data !== undefined && { data }),
...(function_call !== undefined && {
function_call: function_call,
}),
Expand Down Expand Up @@ -325,7 +334,7 @@
mutateLoading(false);
}
},
[

Check warning on line 337 in packages/core/react/use-chat.ts

View workflow job for this annotation

GitHub Actions / ESLint

React Hook useCallback has a missing dependency: 'streamMode'. Either include it or remove the dependency array
mutate,
mutateLoading,
api,
Expand Down
Loading