Skip to content

Instruction-based tools #5809

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

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft

Conversation

RomneyDa
Copy link
Collaborator

@RomneyDa RomneyDa commented May 23, 2025

Description

  • Adds support for tools in the form of XML system message instructions and response content parsing
  • For now, this applies only to models that are NOT known to support native tools
  • All models can now be used in Agent mode
  • Tests for tool conversion and parsing
  • Adds a warning to the Agent mode dropdown that shows for any models not known to be great with tools (including models that support native tools)
image

Summary by cubic

Added support for non-native tool calls using XML parsing, allowing the app to handle tool calls from models that do not support native tool call APIs.

  • New Features

    • Parses and intercepts tool calls in XML format from assistant messages.
    • Generates system prompts and tool definitions for XML-based tool calls.
    • Includes tests for XML parsing and tool call extraction.
  • Dependencies

    • Added fast-xml-parser for XML parsing in the GUI.

Copy link

netlify bot commented May 23, 2025

Deploy Preview for continuedev canceled.

Name Link
🔨 Latest commit 017bb24
🔍 Latest deploy log https://app.netlify.com/projects/continuedev/deploys/6833a124fe5b0d0008dffe98

Copy link

@continue-code-review continue-code-review bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 Incremental review for latest commit: Found 4 issues in the latest commit

@@ -292,9 +293,12 @@ class Bedrock extends BaseLLM {
const convertedMessages = this._convertMessages(messages);

const shouldCacheSystemMessage =
!!systemMessage && this.cacheBehavior?.cacheSystemMessage || this.completionOptions.promptCaching;
(!!systemMessage && this.cacheBehavior?.cacheSystemMessage) ||

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using !!options.tools is redundant. Consider using just options.tools since the && operator will short-circuit if options.tools is falsy.

@@ -49,6 +55,7 @@ export const PROVIDER_TOOL_SUPPORT: Record<
return true;
}
// firworks-ai https://docs.fireworks.ai/guides/function-calling
// TODO - should be under fireworks provider?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This comment indicates a potential misplacement of Fireworks AI logic. The code should be moved to a dedicated fireworks provider instead of being embedded in the openai provider logic.

@@ -156,7 +154,7 @@ function InputToolbar(props: InputToolbarProps) {
>
{!props.toolbarOptions?.hideUseCodebase && mode !== "edit" && (
<div
className={`${toolsSupported ? "md:flex" : "int:flex"} hover:underline" hidden transition-colors duration-200`}
className={`hover:underline" hidden transition-colors duration-200 md:flex`}

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The CSS class string contains a stray quote character and malformed class structure: "hover:underline" hidden transition-colors duration-200 md:flex". This should be cleaned up to remove the extra quotes.


// Set up completions options with tools
const completionOptions: LLMFullCompletionOptions =
useNative && activeTools.length

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using ternary operator with empty object fallback could be simplified. Consider using a more explicit conditional assignment for better readability.

@RomneyDa RomneyDa changed the title Dallin/non native tools experiment Instruction-based tools May 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Todo
Development

Successfully merging this pull request may close these issues.

1 participant