Skip to content

Commit

Permalink
feat: generate code tool into index_widget
Browse files Browse the repository at this point in the history
  • Loading branch information
marcomariscal committed Sep 25, 2023
1 parent d237a5a commit 5390e55
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions tools/index_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -390,6 +390,19 @@ def fn(token_handler):
tool._run(query)
return fn

@error_wrap
def generate_code(query: str) -> Callable:
def fn(token_handler):
tool = dict(
type="tools.index_generate_code.IndexGenerateCodeTool",
_streaming=True,
name="GenerateCode",
content_description="", # not used
)
tool = streaming.get_streaming_tools([tool], token_handler)[0]
tool._run(query)
return fn


class ListContainer(ContainerMixin, list):
def message_prefix(self) -> str:
Expand Down

0 comments on commit 5390e55

Please sign in to comment.