Skip to content
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

fix(playground): make messages collapsible so they can be dragged #5062

Merged
merged 2 commits into from
Oct 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/pages/playground/PlaygroundChatTemplate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,7 @@ function SortableMessageItem({
return (
<li ref={setNodeRef} style={dragAndDropLiStyles}>
<Card
collapsible
variant="compact"
bodyStyle={{ padding: 0 }}
{...messageCardStyles}
Expand Down
2 changes: 1 addition & 1 deletion app/src/pages/playground/__tests__/playgroundUtils.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ const expectedPlaygroundInstanceWithIO: PlaygroundInstance = {
},
input: { variableKeys: [], variablesValueCache: {} },
tools: [],
toolChoice: undefined,
toolChoice: "auto",
template: {
__type: "chat",
// These id's are not 0, 1, 2, because we create a playground instance (including messages) at the top of the transformSpanAttributesToPlaygroundInstance function
Expand Down
3 changes: 2 additions & 1 deletion app/src/store/playground/playgroundStore.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ export function createPlaygroundInstance(): PlaygroundInstance {
template: generateChatCompletionTemplate(),
model: { provider: DEFAULT_MODEL_PROVIDER, modelName: "gpt-4o" },
tools: [],
toolChoice: undefined,
// Default to auto tool choice as you are probably testing the LLM for it's ability to pick
toolChoice: "auto",
// TODO(apowell) - use datasetId if in dataset mode
input: { variablesValueCache: {}, variableKeys: [] },
output: undefined,
Expand Down
6 changes: 5 additions & 1 deletion app/src/store/playground/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,11 @@ export interface PlaygroundInstance {
id: number;
template: PlaygroundTemplate;
tools: Tool[];
toolChoice: ToolChoice | undefined;
/**
* How the LLM should choose the tool to use
* @default "auto"
*/
toolChoice: ToolChoice;
input: PlaygroundInput;
model: ModelConfig;
output: ChatMessage[] | undefined | string;
Expand Down
Loading