Spaces:
Build error
Build error
fix deployment id is None error
Browse files
agentverse/llms/openai.py
CHANGED
@@ -45,7 +45,7 @@ else:
|
|
45 |
|
46 |
class OpenAIChatArgs(BaseModelArgs):
|
47 |
model: str = Field(default="gpt-3.5-turbo")
|
48 |
-
deployment_id: str = Field(default=
|
49 |
max_tokens: int = Field(default=2048)
|
50 |
temperature: float = Field(default=1.0)
|
51 |
top_p: int = Field(default=1)
|
@@ -341,6 +341,6 @@ def get_embedding(text: str, attempts=3) -> np.array:
|
|
341 |
)["data"][0]["embedding"]
|
342 |
return tuple(embedding)
|
343 |
except Exception as e:
|
344 |
-
|
345 |
logger.error(f"Error {e} when requesting openai models. Retrying")
|
346 |
raise
|
|
|
45 |
|
46 |
class OpenAIChatArgs(BaseModelArgs):
|
47 |
model: str = Field(default="gpt-3.5-turbo")
|
48 |
+
deployment_id: str = Field(default="")
|
49 |
max_tokens: int = Field(default=2048)
|
50 |
temperature: float = Field(default=1.0)
|
51 |
top_p: int = Field(default=1)
|
|
|
341 |
)["data"][0]["embedding"]
|
342 |
return tuple(embedding)
|
343 |
except Exception as e:
|
344 |
+
attempts += 1
|
345 |
logger.error(f"Error {e} when requesting openai models. Retrying")
|
346 |
raise
|