Skip to content

Commit

Permalink
fix: rename
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Sep 26, 2023
1 parent 2cce3af commit 5387440
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 9 deletions.
3 changes: 0 additions & 3 deletions chat/display_widgets.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,9 +201,6 @@ def _widgetize_inner(command: str, params: str, depth: int = 0) -> str:
elif command == 'withdraw-vault':
items = params.split(",")
lines.append(f"Withdraw vault action for token: {items[0]}, amount: {items[1]}.")
elif command == 'generate-code':
items = params.split(",")
lines.append(f"supply the user with valid javascript code to run and perform their desired action.")
else:
# assert 0, f'unrecognized command: {command}({params})'
lines.append(f"An unrecognized command: {command}({params})")
Expand Down
2 changes: 1 addition & 1 deletion knowledge_base/widgets.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@
- vault
type: object
return_value_description: ''
- _name_: display_generate_code
- _name_: generate_js_code
description: generate code for the user; this widget should always be chosen for anything relating to code
parameters:
properties:
Expand Down
2 changes: 1 addition & 1 deletion tools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@
from . import index_api_tool
from . import app_usage_guide
from . import index_link_suggestion
from . import index_generate_code
from . import generate_js_code
2 changes: 1 addition & 1 deletion tools/index_generate_code.py → tools/generate_js_code.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@


@registry.register_class
class IndexGenerateCodeTool(BaseTool):
class GenerateJSCodeTool(BaseTool):
"""Tool for generating code to perform a user request."""

_chain: LLMChain
Expand Down
6 changes: 3 additions & 3 deletions tools/index_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ def fn(token_handler):
return fn

@error_wrap
def generate_code(query: str) -> Callable:
def generate_js_code(query: str) -> Callable:
def fn(token_handler):
tool = dict(
name="IndexGenerateCodeTool",
type="tools.index_generate_code.IndexGenerateCodeTool",
name="GenerateJSCodeTool",
type="tools.generate_js_code.GenerateJSCodeTool",
_streaming=True,
)
tool = streaming.get_streaming_tools([tool], token_handler)[0]
Expand Down

0 comments on commit 5387440

Please sign in to comment.