-
Notifications
You must be signed in to change notification settings - Fork 308
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: ContentPartComponent types (#260)
- Loading branch information
Showing
11 changed files
with
85 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
"@assistant-ui/react-hook-form": patch | ||
"@assistant-ui/react": patch | ||
--- | ||
|
||
feat: ContentPartComponent types |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,7 +24,7 @@ const MyApp = () => { | |
}; | ||
``` | ||
|
||
### Properties | ||
#### Properties | ||
|
||
<ParametersTable | ||
parameters={[ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 4 additions & 7 deletions
11
packages/react/src/context/stores/AssistantToolRenderers.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/react/src/primitives/message/ContentPartComponentTypes.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
"use client"; | ||
import type { ComponentType } from "react"; | ||
import type { | ||
ImageContentPart, | ||
TextContentPart, | ||
ToolCallContentPart, | ||
UIContentPart, | ||
} from "../../utils/AssistantTypes"; | ||
|
||
type ContentPartStatus = "done" | "in_progress" | "error"; | ||
|
||
export type TextContentPartProps = { | ||
part: TextContentPart; | ||
status: ContentPartStatus; | ||
}; | ||
export type TextContentPartComponent = ComponentType<TextContentPartProps>; | ||
|
||
export type ImageContentPartProps = { | ||
part: ImageContentPart; | ||
status: ContentPartStatus; | ||
}; | ||
export type ImageContentPartComponent = ComponentType<ImageContentPartProps>; | ||
|
||
export type UIContentPartProps = { | ||
part: UIContentPart; | ||
status: ContentPartStatus; | ||
}; | ||
export type UIContentPartComponent = ComponentType<UIContentPartProps>; | ||
|
||
// biome-ignore lint/suspicious/noExplicitAny: intentional any | ||
export type ToolCallContentPartProps<TArgs = any, TResult = any> = { | ||
part: ToolCallContentPart<TArgs, TResult>; | ||
status: ContentPartStatus; | ||
}; | ||
|
||
export type ToolCallContentPartComponent< | ||
// biome-ignore lint/suspicious/noExplicitAny: intentional any | ||
TArgs = any, | ||
// biome-ignore lint/suspicious/noExplicitAny: intentional any | ||
TResult = any, | ||
> = ComponentType<ToolCallContentPartProps<TArgs, TResult>>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters