useTools option
This commit is contained in:
parent
045c450e4d
commit
13181dc32c
6 changed files with 17 additions and 2 deletions
|
|
@ -384,7 +384,6 @@ export class Core {
|
|||
const model = await configHandler.llmFromTitle(msg.data.title);
|
||||
|
||||
if (msg.data.useTools) {
|
||||
// Array.isArray(config.experimental?.allowTools)) {
|
||||
msg.data.completionOptions.tools = allTools;
|
||||
}
|
||||
|
||||
|
|
|
|||
1
core/index.d.ts
vendored
1
core/index.d.ts
vendored
|
|
@ -1158,6 +1158,7 @@ interface ExperimentalConfig {
|
|||
* This is needed to crawl a large number of documentation sites that are dynamically rendered.
|
||||
*/
|
||||
useChromiumForDocsCrawling?: boolean;
|
||||
useTools?: boolean;
|
||||
}
|
||||
|
||||
interface AnalyticsConfig {
|
||||
|
|
|
|||
|
|
@ -3023,6 +3023,11 @@
|
|||
"type": "boolean",
|
||||
"description": "Use Chromium to crawl docs locally. Useful if the default Cheerio crawler fails on sites that require JavaScript rendering. Downloads and installs Chromium to `~/.continue/.utils`.",
|
||||
"default": false
|
||||
},
|
||||
"useTools": {
|
||||
"type": "boolean",
|
||||
"description": "Allow tool use. Currently only supported with Claude 3.5 Sonnet",
|
||||
"default": true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -68,6 +68,9 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
|
|||
const availableContextProviders = useSelector(
|
||||
(store: RootState) => store.state.config.contextProviders,
|
||||
);
|
||||
const useTools = useSelector(
|
||||
(store: RootState) => store.state.config.experimental?.useTools,
|
||||
);
|
||||
|
||||
useWebviewListener(
|
||||
"newSessionWithPrompt",
|
||||
|
|
@ -108,7 +111,7 @@ function ContinueInputBox(props: ContinueInputBoxProps) {
|
|||
availableSlashCommands={availableSlashCommands}
|
||||
historyKey="chat"
|
||||
toolbarOptions={{
|
||||
hideTools: true,
|
||||
hideTools: !useTools,
|
||||
}}
|
||||
/>
|
||||
</GradientBorder>
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ export interface IIdeMessenger {
|
|||
cancelToken: AbortSignal | undefined,
|
||||
messages: ChatMessage[],
|
||||
options?: LLMFullCompletionOptions,
|
||||
useTools?: boolean,
|
||||
): AsyncGenerator<ChatMessage, PromptLog, unknown>;
|
||||
|
||||
ide: IDE;
|
||||
|
|
@ -202,6 +203,7 @@ export class IdeMessenger implements IIdeMessenger {
|
|||
cancelToken: AbortSignal | undefined,
|
||||
messages: ChatMessage[],
|
||||
options: LLMFullCompletionOptions = {},
|
||||
useTools?: boolean,
|
||||
): AsyncGenerator<ChatMessage, PromptLog> {
|
||||
const gen = this.streamRequest(
|
||||
"llm/streamChat",
|
||||
|
|
@ -209,6 +211,7 @@ export class IdeMessenger implements IIdeMessenger {
|
|||
messages,
|
||||
title: modelTitle,
|
||||
completionOptions: options,
|
||||
useTools,
|
||||
},
|
||||
cancelToken,
|
||||
);
|
||||
|
|
|
|||
|
|
@ -63,6 +63,8 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
|||
const streamAborter = useSelector(
|
||||
(store: RootState) => store.state.streamAborter,
|
||||
);
|
||||
const useTools = useSelector((store: RootState) => store.uiState.useTools);
|
||||
|
||||
const activeRef = useRef(active);
|
||||
|
||||
const { saveSession } = useHistory(dispatch);
|
||||
|
|
@ -85,6 +87,8 @@ function useChatHandler(dispatch: Dispatch, ideMessenger: IIdeMessenger) {
|
|||
defaultModel.title,
|
||||
streamAborter.signal,
|
||||
messages,
|
||||
{},
|
||||
useTools,
|
||||
);
|
||||
let next = await gen.next();
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue