Skip to content

Commit 7a05550

Browse files
fix(graphgen/models): fix generating error when api_key is empty str
1 parent ea9e3d0 commit 7a05550

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

graphgen/models/llm/openai_model.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@ class OpenAIModel(TopkTokenModel):
4545

4646
def __post_init__(self):
4747
assert self.api_key is not None, "Please provide api key to access openai api."
48+
if self.api_key == "":
49+
self.api_key = "none"
4850
self.client = AsyncOpenAI(api_key=self.api_key, base_url=self.base_url)
4951

5052
def _pre_generate(self, text: str, history: List[str]) -> Dict:

0 commit comments

Comments
 (0)