e768098d0e
Flake8 Lint / flake8 (push) Waiting to run
Spell check CI / Spell_Check (push) Waiting to run
tools_continuous_delivery / Private PyPI non-main branch release (push) Has been skipped
tools_continuous_delivery / Private PyPI main branch release (push) Failing after 2m42s
Publish Promptflow Doc / Build (push) Has been cancelled
Publish Promptflow Doc / Deploy (push) Has been cancelled
15 lines
474 B
Django/Jinja
15 lines
474 B
Django/Jinja
from promptflow import ToolProvider, tool
|
|
import urllib.request
|
|
|
|
|
|
class {{ class_name }}(ToolProvider):
|
|
|
|
def __init__(self, url: str):
|
|
super().__init__()
|
|
# Load content from url might be slow, so we do it in __init__ method to make sure it is loaded only once.
|
|
self.content = urllib.request.urlopen(url).read()
|
|
|
|
@tool
|
|
def {{ function_name }}(self, query: str) -> str:
|
|
# Replace with your tool code.
|
|
return "Hello " + query |