-
Notifications
You must be signed in to change notification settings - Fork 284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(playground): add non streaming option to ui #5250
base: main
Are you sure you want to change the base?
Conversation
88441b8
to
caa8dd9
Compare
@@ -125,6 +140,8 @@ export function PlaygroundOutput(props: PlaygroundOutputProps) { | |||
); | |||
} | |||
return "click run to see output"; | |||
// eslint-disable-next-line react-compiler/react-compiler | |||
// eslint-disable-next-line react-hooks/exhaustive-deps | |||
}, [hasRunId, instance.output, instanceId, runId]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is hacky, but does work we have to remove streaming from deps array otherwise when you toggle it it will switch and rerun the mutation or stream (whichever you're switching to)
@@ -253,7 +270,136 @@ function toGqlChatCompletionRole( | |||
} | |||
} | |||
|
|||
function PlaygroundOutputText(props: PlaygroundInstanceProps) { | |||
function NonStreamingPlaygroundOutputText(props: PlaygroundInstanceProps) { | |||
const instances = usePlaygroundContext((state) => state.instances); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is just copied from streaming, can probably make a wrapper and just change the subscription or mutation, just wanted to get something out
@@ -388,7 +536,7 @@ function PlaygroundOutputText(props: PlaygroundInstanceProps) { | |||
}, | |||
}); | |||
|
|||
if (instance.isRunning) { | |||
if (output == null && toolCalls.length === 0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axiomofjoy you made this change, but it breaks streaming since the instance is still running while the chunks are coming in, it doesn't show the output till it's all done, i reverted it back but wanted to make sure the change wasn't fixing some other issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
alternatively we can mark it as complete when the first chunk comes in but not sure if that's the right call
"TOOL_CHOICE" | ||
> = "TOOL_CHOICE"; | ||
|
||
export const TOOL_CHOICE_PARAM_NAME = "tool_choice"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is not necessarily stable, we need to pull from the backend and map this and use the real models tool_choice name at run time, or allow passing in one of the canonical or param name to the subscription cc @cephalization @anticorrelator, right now they are all the same so it doesn't matter
@@ -0,0 +1,14 @@ | |||
import strawberry |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dummy to be removed when #4774 is done
resolves #5250