Skip to content

Commit dec4737

Browse files
committed
feat(workflow): add Google Search toggle to LLM node
- Add hasGoogleSearch property to LLMNode type - Implement Google Search toggle in LLM node property editor - Update executeLLMNode function with isGoogleSearchEnabled parameter - Bump version to 1.71.0+2
1 parent e5c0808 commit dec4737

File tree

4 files changed

+15
-1
lines changed

4 files changed

+15
-1
lines changed

vscode/package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "cody-ai",
44
"private": true,
55
"displayName": "Cody: AI Code Assistant",
6-
"version": "1.71.0+1",
6+
"version": "1.71.0+2",
77
"publisher": "sourcegraph",
88
"license": "Apache-2.0",
99
"icon": "resources/sourcegraph.png",

vscode/src/workflow/workflow-executor.ts

+1
Original file line numberDiff line numberDiff line change
@@ -604,6 +604,7 @@ async function executeLLMNode(
604604
model:
605605
(node as LLMNode).data.model?.id ??
606606
'anthropic::2024-10-22::claude-3-5-sonnet-latest',
607+
isGoogleSearchEnabled: (node as LLMNode).data.hasGoogleSearch,
607608
},
608609
abortSignal
609610
)

vscode/webviews/workflow/components/PropertyEditor.tsx

+12
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,18 @@ export const PropertyEditor: React.FC<PropertyEditorProps> = ({
274274
{(node as LLMNode).data.maxTokens || 250}
275275
</span>
276276
</div>
277+
{selectedModel?.clientSideConfig?.options?.googleSearch && (
278+
<div className="tw-flex tw-items-center tw-space-x-2">
279+
<Checkbox
280+
id="node-google-search"
281+
checked={(node as LLMNode).data.hasGoogleSearch || false}
282+
onCheckedChange={checked =>
283+
onUpdate(node.id, { hasGoogleSearch: checked === true })
284+
}
285+
/>
286+
<Label htmlFor="node-google-search">Google Search</Label>
287+
</div>
288+
)}
277289
</div>
278290
)}
279291
{node.type === NodeType.INPUT && (

vscode/webviews/workflow/components/nodes/LLM_Node.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ export type LLMNode = Omit<WorkflowNode, 'data'> & {
1717
temperature: number
1818
maxTokens?: number
1919
model?: Model
20+
hasGoogleSearch: boolean
2021
}
2122
}
2223

0 commit comments

Comments
 (0)