You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
30 lines
908 B
30 lines
908 B
import os
|
|
import sys
|
|
from dotenv import load_dotenv
|
|
from swarms.models.revgptV4 import RevChatGPTModelv4
|
|
from swarms.models.revgptV1 import RevChatGPTModelv1
|
|
|
|
root_dir = os.path.dirname(os.path.dirname(os.path.realpath(__file__)))
|
|
sys.path.append(root_dir)
|
|
|
|
load_dotenv()
|
|
|
|
config = {
|
|
"model": os.getenv("REVGPT_MODEL"),
|
|
"plugin_ids": [os.getenv("REVGPT_PLUGIN_IDS")],
|
|
"disable_history": os.getenv("REVGPT_DISABLE_HISTORY") == "True",
|
|
"PUID": os.getenv("REVGPT_PUID"),
|
|
"unverified_plugin_domains": [os.getenv("REVGPT_UNVERIFIED_PLUGIN_DOMAINS")],
|
|
}
|
|
|
|
# For v1 model
|
|
model = RevChatGPTModelv1(access_token=os.getenv("ACCESS_TOKEN"), **config)
|
|
# model = RevChatGPTModelv4(access_token=os.getenv("ACCESS_TOKEN"), **config)
|
|
|
|
# For v3 model
|
|
# model = RevChatGPTModel(access_token=os.getenv("OPENAI_API_KEY"), **config)
|
|
|
|
task = "Write a cli snake game"
|
|
response = model.run(task)
|
|
print(response)
|