-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(playground): rudimentary graphql support for messages input (#4907)
* feat(playground): Chat message with role * feat(playground): pass in messages and roles * Update app/src/pages/playground/MessageRolePicker.tsx
- Loading branch information
1 parent
72f05de
commit ee1f85b
Showing
8 changed files
with
159 additions
and
27 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
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
21 changes: 13 additions & 8 deletions
21
app/src/pages/playground/__generated__/PlaygroundOutputSubscription.graphql.ts
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
12 changes: 12 additions & 0 deletions
12
src/phoenix/server/api/input_types/ChatCompletionMessageInput.py
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,12 @@ | ||
import strawberry | ||
from strawberry.scalars import JSON | ||
|
||
from phoenix.server.api.types.ChatCompletionMessageRole import ChatCompletionMessageRole | ||
|
||
|
||
@strawberry.input | ||
class ChatCompletionMessageInput: | ||
role: ChatCompletionMessageRole | ||
content: JSON = strawberry.field( | ||
description="The content of the message as JSON to support text and tools", | ||
) |
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,11 @@ | ||
from enum import Enum | ||
|
||
import strawberry | ||
|
||
|
||
@strawberry.enum | ||
class ChatCompletionMessageRole(Enum): | ||
USER = "USER" | ||
SYSTEM = "SYSTEM" | ||
TOOL = "TOOL" | ||
AI = "AI" # E.g. the assistant. Normalize to AI for consistency. |