Comments (9)
Can you use reload
? https://sdk.vercel.ai/docs/api-reference/use-chat
from ai.
@MaxLeiter unfortunately not, reload works differently. Instead of adding another assistant response, it removes the last assistant response and requests a new one. So you couldn't use it to make the hook request another assistant message without providing an additional user message.
from ai.
I think you can call append
manually with role
set to 'assistant'
?
from ai.
@shuding I don't believe so, append
looks like it's more for adding a message with content you already have, not asking for a new message to be generated.
from ai.
It seems like we need a new option in reload
to explicitly send a request without removing the last assistant response. For example reload({ removeLastAssistantMessage: true })
. Need a better name though.
from ai.
It seems like we need a new option in
reload
to explicitly send a request without removing the last assistant response. For examplereload({ removeLastAssistantMessage: true })
. Need a better name though.
Maybe even more flexibility? reload(messages => transformTheMessagesBeforeSendingThem(messages))
I need this so I can modify the last user
message before reloading.
from ai.
Love the idea from @pomber, vote for this:
reload({
transform: (messages) => newMessages
})
So we can have other options added in the future. PR welcome!
from ai.
from ai.
#2164 adds support to submitting form without adding a message while using handleSubmit
from ai.
Related Issues (20)
- Using experimental_attachments with empty input doesn't append the message HOT 2
- Submit useChat messages as core messages HOT 2
- Tweak documentation for AI SDK UI -> OpenAI Assistants
- Implicit `Buffer` usage fails in Cloudflare Workers HOT 1
- Invalid JSON payload received (Google Provider). HOT 12
- Unable to get 8192 tokens back from claude using streamText() HOT 4
- Composing "streamableUI" elements throws "TypeError: Cannot read properties of null (reading 'children')" HOT 1
- When using >0 maxToolRoundTrips onFinish gets called prematurely
- Unknown name minItems - Google AI SDK and OpenAI SDK HOT 1
- Token Usage with LiteLLM HOT 2
- More Gemini safety categories HOT 1
- Error is thrown while using `useChat` in client component in 3.3 HOT 2
- Using a schema with useChat HOT 7
- On bedrock can't set tokens for claude-sonnet-3-5 > 4096 even though the model supports it HOT 1
- Module not found: Can't resolve '@google-cloud/vertexai' HOT 1
- convertToCoreMessages does not convert Message[] to CoreMessage[]
- Bedrock client does not work natively with profiles, instance roles, container roles, etc. HOT 1
- Add Ai21Lab Provider @ai-sdk/ai21 for Jamba 1.5 Models
- streamObject breaks with undefined (Mistral provider) HOT 1
- OpenAI Model tries to call unavailable tool `multi_tool_use.parallel` HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ai.