-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathretrieve_test.py
50 lines (37 loc) · 1.21 KB
/
retrieve_test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import autogen
# load OPENAI_API_KEY from .env file
from dotenv import load_dotenv
from browser_proxy_agent import BrowserProxyAgent
from retrieve_html_proxy_agent import RetrieveHTMLProxyAgent
load_dotenv()
# print the OPENAI_API_KEY
import os
print(os.environ["OPENAI_API_KEY"])
config_list = autogen.config_list_from_json(
"OAI_CONFIG_LIST",
file_location=".",
filter_dict={
"model": {
"gpt-3.5-turbo-16k",
}
}
)
print(config_list)
html_assistant = autogen.AssistantAgent(
name="html_assistant",
llm_config={"config_list": config_list},
# the default system message of the AssistantAgent is overwritten here
system_message='''You are a helpful AI Assistant. You help users with their HTML questions. '''
)
# create a UserProxyAgent instance to interact with html_assistant
html_proxy = RetrieveHTMLProxyAgent(
name="html_user_proxy",
human_input_mode="NEVER",
max_consecutive_auto_reply=0,
)
# continuous prompt for the user to ask questions
while True:
# get the user's question
user_question = input("What is your question?\n")
# initiate the chat with the code_generator
html_proxy.initiate_chat(html_assistant, message=user_question)