forked from Significant-Gravitas/AutoGPT
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Significant-Gravitas#1.browse_website配置代理
Significant-Gravitas#2.中文提示词(对返回结果有些影响、token消耗大,暂时注掉) Significant-Gravitas#3.优化代码,待适配文本转向量接口
- Loading branch information
lianchen.zhang
committed
Nov 8, 2023
1 parent
92ecdde
commit f1078d0
Showing
14 changed files
with
74 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
"""The configuration encapsulates settings for all Agent subsystems.""" | ||
import os | ||
|
||
from autogpt.core.configuration.schema import ( | ||
Configurable, | ||
SystemConfiguration, | ||
SystemSettings, | ||
UserConfigurable, | ||
) | ||
QUNAR_PROXY_HOST = os.environ.get("QUNAR_PROXY_HOST") | ||
QUNAR_PROXY_PORT = os.environ.get("QUNAR_PROXY_PORT") | ||
QUNAR_PROXY_USR = os.environ.get("QUNAR_PROXY_USR") | ||
QUNAR_PROXY_PWD = os.environ.get("QUNAR_PROXY_PWD") | ||
proxies = { | ||
'http': f'http://{QUNAR_PROXY_HOST}:{QUNAR_PROXY_PORT}', | ||
'https': f'http://{QUNAR_PROXY_HOST}:{QUNAR_PROXY_PORT}' | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
9 changes: 2 additions & 7 deletions
9
autogpt/qunar/qunar_gpt.py → ...i_resources/abstract/EngineApiResource.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import time | ||
|
||
from openai import util | ||
from openai.error import TryAgain | ||
|
||
from autogpt.qunar.api_resources.abstract.EngineApiResource import EngineAPIResource | ||
|
||
|
||
class QChatCompletion(EngineAPIResource): | ||
|
||
@classmethod | ||
def create(cls, *args, **kwargs): | ||
""" | ||
Creates a new chat completion for the provided messages and parameters. | ||
See https://platform.openai.com/docs/api-reference/chat-completions/create | ||
for a list of valid parameters. | ||
""" | ||
start = time.time() | ||
timeout = kwargs.pop("timeout", None) | ||
|
||
while True: | ||
try: | ||
return super().create(*args, **kwargs) | ||
except TryAgain as e: | ||
if timeout is not None and time.time() > start + timeout: | ||
raise | ||
|
||
util.log_info("Waiting for model to warm up", error=e) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
version: "3.9" | ||
|
||
services: | ||
auto-gpt: | ||
qunar-auto-gpt: | ||
build: ./ | ||
env_file: | ||
- .env | ||
|