Skip to content

Commit

Permalink
small typos
Browse files Browse the repository at this point in the history
  • Loading branch information
jwlee64 committed Nov 7, 2024
1 parent 35920bd commit 31be98e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,14 @@ export const PlaygroundCallStats = ({call}: {call: TraceCallSchema}) => {
<div className="flex w-full items-center justify-center gap-8 py-8 text-sm text-moon-500">
<span>Latency: {latency}ms</span>
<span></span>
{/* <span>Finish reason: {choice.finish_reason}</span>
<span>•</span> */}
{(call.output as any)?.choices?.[0]?.finish_reason && (
<>
<span>
Finish reason: {(call.output as any).choices[0].finish_reason}
</span>
<span></span>
</>
)}
<span>{totalTokens} tokens</span>
<span></span>
{callLink && (
Expand All @@ -64,7 +70,6 @@ export const PlaygroundCallStats = ({call}: {call: TraceCallSchema}) => {
View trace
</Button>
)}
{/* <span>•</span> */}
{weaveRef && <Reactions weaveRef={weaveRef} forceVisible={true} />}
</div>
</Tailwind>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export type PlaygroundPageProps = {
export const PlaygroundPage = (props: PlaygroundPageProps) => {
return (
<SimplePageLayout
title={'Playground'}
title={'Playground (preview)'}
hideTabsIfSingle
tabs={[
{
Expand Down Expand Up @@ -79,7 +79,7 @@ export const PlaygroundPageInner = (props: PlaygroundPageProps) => {
}
// Only set the call the first time the page loads, and we get the call
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [props.callId]);
}, [call.loading]);

useEffect(() => {
setPlaygroundStates(prev => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,9 @@ export const getInputFromPlaygroundState = (state: PlaygroundState) => {
function: func,
}));
return {
// Adding this to prevent the exact same call from not getting run when i want it too
request_key: `${Date.now()}-${Math.random()}`,
// Adding this to prevent the exact same call from not getting run
// eg running the same call in parallel
key: Math.random() * 1000,

messages: state.traceCall?.inputs?.messages,
model: state.model,
Expand Down

0 comments on commit 31be98e

Please sign in to comment.