Unverified Commit 5679edb4 authored by bittersweet1999's avatar bittersweet1999 Committed by GitHub
Browse files

add temperature in alles (#787)

parent ad872a5d
......@@ -334,6 +334,7 @@ class OpenAIAllesAPIN(OpenAI):
path: str,
url: str,
key: str,
temperature: float = 1.0,
query_per_second: int = 1,
rpm_verbose: bool = False,
max_seq_len: int = 2048,
......@@ -346,6 +347,7 @@ class OpenAIAllesAPIN(OpenAI):
meta_template=meta_template,
retry=retry)
self.url = url
self.temperature = temperature
self.headers = {
'alles-apin-token': key,
'content-type': 'application/json',
......@@ -387,11 +389,12 @@ class OpenAIAllesAPIN(OpenAI):
# model can be response with user and system
# when it comes with agent involved.
assert msg['role'] in ['user', 'system']
data = {
'model': self.path,
'messages': messages,
'temperature': temperature
}
for _ in range(self.retry):
self.wait()
raw_response = requests.post(self.url,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment