- 3164adb: Fix regression with generated ids
- fd82961: Use rfc4122 IDs when generating chat/completion IDs
- b7b93e5: Add RSC to ai/react
- 8bf637a: Fix langchain handlers so that they now are correctly invoked and update examples and docs to show correct usage (passing the handlers to
llm.call
and not the model itself).
- a7b3d0e: Experimental support for OpenAI function calling
- 9cdf968: core/react: add Tokens react server component
- 44d9879: Support extra request options in chat and completion hooks
- bde3898: Allow an async onResponse callback in useChat/useCompletion
- 23f0899: Set stream: true when decoding streamed chunks
- 89938b0: Provider direct callback handlers in LangChain now that
CallbackManager
is deprecated.
- c16d650: Improve type saftey for AIStream. Added JSDoc comments.
- a9591fe: Add
createdAt
onuser
input message inuseChat
(it was already present inassistant
messages)
- f37d4ec: fix bundling
- 9fdb51a: fix: add better typing for store within svelte implementation (#104)
- 71f9c51: This adds Vue support for
ai
via theai/vue
subpath export. Vue composablesuseChat
anduseCompletion
are provided.
- ad54c79: add tests
- be90740: - Switches
LangChainStream
helper callbackhandler
to return usehandleChainEnd
instead ofhandleLLMEnd
so as to work with sequential chains
- 095de43: New package name!
- c6586a2: Add onError callback, include response text in error if response is not okay
- c1f4a91: Throw error when provided AI response isn't valid
- ea4e66a: improve API types
- a6bc35c: fix package exports for react and svelte subpackages
- 56f9537: add svelte apis
- 78477d3: - Create
/react
sub-package.- Create
import { useChat, useCompletion } from 'ai/react'
and mark React as an optional peer dependency so we can add more framework support in the future. - Also renamed
set
tosetMessages
andsetCompletion
to unify the API naming as we havesetInput
too. - Added an
sendExtraMessageFields
field touseChat
that defaults tofalse
, to prevent OpenAI errors whenid
is not filtered out.
- Create
- c4c1be3: useCompletion.handleSubmit does not clear the input anymore
- 7de2185: create /react export
- fc83e95: Implement new start-of-stream newline trimming
- 2c6fa04: Optimize callbacks TransformStream to be more memory efficient when
onCompletion
is not specified
- fdfef52: - Splits the
EventSource
parser into a reusable helper- Uses a
TransformStream
for this, so the stream respects back-pressure - Splits the "forking" stream for callbacks into a reusable helper
- Changes the signature for
customParser
to avoid Stringify -> Encode -> Decode -> Parse round trip - Uses ?.() optional call syntax for callbacks
- Uses string.includes to perform newline checking
- Handles the
null
res.body
case - Fixes Anthropic's streaming responses
- Anthropic returns cumulative responses, not deltas like OpenAI
- https://github.com/hwchase17/langchain/blob/3af36943/langchain/llms/anthropic.py#L190-L193
- Uses a
- d70a9e7: Add streamToResponse
- 47b85b2: Improve abortController and callbacks of
useChat
- 6f7b43a: Export
UseCompletionHelpers
as a TypeScript type alias
- 4405a8a: fix duplicated
'use client'
directives
- b869104: Added
LangChainStream
,useCompletion
, anduseChat
- 677d222: add useCompletion
- af400e2: Fix release script
- b7e227d: Add
useChat
hook
- 9a8a845: Testing out release