-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(playground): streaming chat completions (#4785)
* add subscriptions * configure relay * playground mvp * align the runs for multiple * add more functionality * cleanup the components --------- Co-authored-by: Mikyo King <mikyo@arize.com>
- Loading branch information
1 parent
d7ee8d7
commit 08aeb74
Showing
21 changed files
with
560 additions
and
85 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
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 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,46 @@ | ||
import React from "react"; | ||
import { css } from "@emotion/react"; | ||
|
||
import { Item, Picker } from "@arizeai/components"; | ||
|
||
import { ChatMessageRole } from "@phoenix/store"; | ||
|
||
const hiddenLabelCSS = css` | ||
.ac-field-label { | ||
display: none; | ||
} | ||
`; | ||
|
||
type MessageRolePickerProps = { | ||
/** | ||
* The currently selected message role | ||
*/ | ||
role: ChatMessageRole; | ||
/** | ||
* Whether to display a label for the picker | ||
* This may be set to false in cases where the picker is rendered in a table for instance | ||
* @default true | ||
*/ | ||
includeLabel?: boolean; | ||
}; | ||
|
||
export function MessageRolePicker({ | ||
role, | ||
includeLabel = true, | ||
}: MessageRolePickerProps) { | ||
return ( | ||
<Picker | ||
selectedKey={role} | ||
css={!includeLabel ? hiddenLabelCSS : undefined} | ||
label="Role" | ||
data-testid="inferences-time-range" | ||
aria-label={`Time range for the primary inferences`} | ||
size="compact" | ||
onSelectionChange={() => {}} | ||
> | ||
<Item key="system">System</Item> | ||
<Item key="user">User</Item> | ||
<Item key="assistant">Assistant</Item> | ||
</Picker> | ||
); | ||
} |
Oops, something went wrong.