Skip to content

Commit

Permalink
add playground flag
Browse files Browse the repository at this point in the history
  • Loading branch information
paulclindo committed Oct 4, 2024
1 parent 9b83aa7 commit 6e51159
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ export const useWebSocketMessage = ({
if (lastMessage?.data) {
try {
const parseData: WsMessage = JSON.parse(lastMessage.data);
console.log(parseData, 'parseData');
if (parseData.message_type !== 'Stream' || parseData.inbox !== inboxId)
return;
isStreamingFinished.current = false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,7 @@ function BamlEditor() {
content: escapedBamlInput,
workflowCode,
isHidden: true,
playground: true,
chatConfig: {
stream: false,
custom_prompt: '',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ function WorkflowEditor() {
isHidden: true,
selectedVRFiles,
selectedVRFolders,
playground: true,
});
};
const { mutateAsync: createWorkflow, isPending: isCreateWorkflowPending } =
Expand Down
11 changes: 8 additions & 3 deletions libs/shinkai-message-ts/src/api/jobs/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,14 @@ export type CreateJobRequest = {
local_vrpack: [];
local_vrkai: [];
};
associated_ui: {
Sheet: string;
} | null;
associated_ui:
| null
| {
Sheet: string | null;
}
| {
Playground: '';
};
is_hidden: boolean;
};
};
Expand Down
22 changes: 21 additions & 1 deletion libs/shinkai-node-state/src/v2/mutations/createJob/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,27 @@ export const createJob = async ({
selectedVRFiles,
selectedVRFolders,
chatConfig,
playground,
}: CreateJobInput) => {
let associatedUI:
| null
| {
Sheet: string | null;
}
| {
Playground: '';
} = null;

if (playground) {
associatedUI = {
Playground: '',
};
} else if (sheetId) {
associatedUI = {
Sheet: sheetId,
};
}

const { job_id: jobId } = await createJobApi(nodeAddress, token, {
llm_provider: llmProvider,
job_creation_info: {
Expand All @@ -31,7 +51,7 @@ export const createJob = async ({
local_vrkai: [],
network_folders: [],
},
associated_ui: sheetId ? { Sheet: sheetId } : null,
associated_ui: associatedUI,
is_hidden: isHidden,
},
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export type CreateJobInput = Token & {
selectedVRFiles?: VectorFSItemScopeEntry[];
selectedVRFolders?: VectorFSFolderScopeEntry[];
chatConfig?: JobConfig;
playground?: boolean;
};

export type CreateJobOutput = {
Expand Down

0 comments on commit 6e51159

Please sign in to comment.