-
Notifications
You must be signed in to change notification settings - Fork 693
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add the plugin-only mode which is now only supported by openai models. This is now configured by setting `session.plugin_only_mode=True`. I have removed the old configurations and verifications for the plugin-only mode in the code interpreter (and generator). Now, a new code interpreter and generator are created to handle this mode which relies on the function calling feature of the LLMs.
- Loading branch information
Showing
33 changed files
with
535 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
enabled: True | ||
plugin_only: False | ||
rounds: | ||
- user_query: hello | ||
state: finished | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
enabled: True | ||
plugin_only: False | ||
rounds: | ||
- user_query: read file /abc/def.txt | ||
state: finished | ||
|
70 changes: 0 additions & 70 deletions
70
project/codeinterpreter_examples/example3-codeinterpreter.yaml
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
from taskweaver.plugin import Plugin, register_plugin | ||
|
||
|
||
@register_plugin | ||
class AsciiRenderPlugin(Plugin): | ||
def __call__(self, text: str): | ||
try: | ||
import pyfiglet | ||
except ImportError: | ||
raise ImportError("Please install pyfiglet first.") | ||
|
||
ASCII_art_1 = pyfiglet.figlet_format(text, font="isometric1") | ||
result = ASCII_art_1 | ||
|
||
return result |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: ascii_render | ||
enabled: true | ||
required: true | ||
plugin_only: true | ||
description: >- | ||
This plugin renders the input text into ASCII art form. The input should be a string and the output is also a string in ASCII art. | ||
For example, result = ascii_render("Hello World!"). | ||
parameters: | ||
- name: text | ||
type: str | ||
required: true | ||
description: >- | ||
This is the input text to be rendered into ASCII art form. | ||
returns: | ||
- name: result | ||
type: str | ||
description: >- | ||
The rendered text in ASCII art. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from taskweaver.plugin import Plugin, register_plugin | ||
|
||
|
||
@register_plugin | ||
class TellJoke(Plugin): | ||
def __call__(self, lan: str = "en"): | ||
try: | ||
import pyjokes | ||
except ImportError: | ||
raise ImportError("Please install pyjokes first.") | ||
|
||
# Define the API endpoint and parameters | ||
return pyjokes.get_joke(language=lan, category="neutral") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: tell_joke | ||
enabled: true | ||
required: false | ||
plugin_only: true | ||
description: >- | ||
Call this plugin to tell a joke. For example, result = tell_joke("en"). | ||
parameters: | ||
- name: lan | ||
type: str | ||
required: false | ||
description: the language of the joke. Default is English. It can be en, de, es, it, gl, eu. | ||
|
||
|
||
returns: | ||
- name: joke | ||
type: str | ||
description: the joke. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .code_interpreter import CodeInterpreter, CodeInterpreterConfig | ||
from .code_interpreter import CodeInterpreter | ||
from .code_interpreter_plugin_only import CodeInterpreterPluginOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
from .code_generator import CodeGenerator, CodeGeneratorConfig, format_code_revision_message | ||
from .code_generator_plugin_only import CodeGeneratorPluginOnly |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.