e768098d0e
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
Flake8 Lint / flake8 (push) Has been cancelled
Spell check CI / Spell_Check (push) Has been cancelled
34 lines
1.1 KiB
Python
34 lines
1.1 KiB
Python
from typing import Union
|
|
|
|
from promptflow.core import tool
|
|
from promptflow.connections import AzureOpenAIConnection, OpenAIConnection
|
|
|
|
|
|
@tool
|
|
def autogpt_easy_start(connection: Union[AzureOpenAIConnection, OpenAIConnection], system_prompt: str, user_prompt: str,
|
|
triggering_prompt: str, functions: list, model_or_deployment_name: str, tokens_per_message: int,
|
|
tokens_per_name: int):
|
|
from wiki_search import search
|
|
from python_repl import python
|
|
from autogpt_class import AutoGPT
|
|
|
|
full_message_history = []
|
|
tools = [
|
|
search,
|
|
python
|
|
]
|
|
agent = AutoGPT(
|
|
full_message_history=full_message_history,
|
|
tools=tools,
|
|
system_prompt=system_prompt,
|
|
connection=connection,
|
|
model_or_deployment_name=model_or_deployment_name,
|
|
functions=functions,
|
|
user_prompt=user_prompt,
|
|
triggering_prompt=triggering_prompt,
|
|
tokens_per_message=tokens_per_message,
|
|
tokens_per_name=tokens_per_name,
|
|
)
|
|
result = agent.run()
|
|
return result
|