Skip to content

Commit

Permalink
update ui
Browse files Browse the repository at this point in the history
  • Loading branch information
axiomofjoy committed Oct 31, 2024
1 parent a29f4d2 commit 78f0b0a
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 39 deletions.
7 changes: 2 additions & 5 deletions app/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ enum ChatCompletionMessageRole {
AI
}

type ChatCompletionSubscriptionError {
message: String!
}

union ChatCompletionSubscriptionPayload = TextChunk | ToolCallChunk | FinishedChatCompletion | ChatCompletionSubscriptionError
union ChatCompletionSubscriptionPayload = TextChunk | ToolCallChunk | FinishedChatCompletion

input ClearProjectInput {
id: GlobalID!
Expand Down Expand Up @@ -835,6 +831,7 @@ type ExportedFile {

type FinishedChatCompletion {
span: Span!
errorMessage: String
}

type FunctionCallChunk {
Expand Down
24 changes: 7 additions & 17 deletions app/src/pages/playground/PlaygroundOutput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -200,9 +200,7 @@ function useChatCompletionSubscription({
span {
id
}
}
... on ChatCompletionSubscriptionError {
message
errorMessage
}
}
}
Expand Down Expand Up @@ -378,20 +376,12 @@ function PlaygroundOutputText(props: PlaygroundInstanceProps) {
spanId: chatCompletion.span.id,
},
});
} else if (
chatCompletion.__typename === "ChatCompletionSubscriptionError"
) {
markPlaygroundInstanceComplete(props.playgroundInstanceId);
updateInstance({
instanceId: props.playgroundInstanceId,
patch: {
isRunning: false,
},
});
notifyError({
title: "Chat completion failed",
message: chatCompletion.message,
});
if (chatCompletion.errorMessage != null) {
notifyError({
title: "Chat completion failed",
message: chatCompletion.errorMessage,
});
}
}
},
onCompleted: () => {
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 78f0b0a

Please sign in to comment.