weizechen commited on
Commit
e0d120c
·
1 Parent(s): ec9ceb3

fix deployment id is None error

Browse files
Files changed (1) hide show
  1. agentverse/llms/openai.py +2 -2
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=None)
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
- attempt += 1
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