Skip to content

Commit 176fc08

Browse files
Merge pull request #81 from codefuse-ai/fix74
bufix: fix #74
2 parents 80a5277 + 2acfd17 commit 176fc08

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

muagent/llm_models/openai_model.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def __init__(self, llm_config: LLMConfig, callBack: AsyncIteratorCallbackHandler
6666
http_client=http_client,
6767
timeout=120
6868
)
69-
else:
69+
elif http_client:
7070
self.llm = ChatOpenAI(
7171
streaming=True,
7272
verbose=True,
@@ -78,6 +78,18 @@ def __init__(self, llm_config: LLMConfig, callBack: AsyncIteratorCallbackHandler
7878
timeout=120
7979
# callbacks=[callBack],
8080
)
81+
else:
82+
self.llm = ChatOpenAI(
83+
streaming=True,
84+
verbose=True,
85+
api_key=llm_config.api_key,
86+
model_name=llm_config.model_name,
87+
base_url=llm_config.api_base_url,
88+
temperature=llm_config.temperature,
89+
model_kwargs={"stop": llm_config.stop},
90+
timeout=120
91+
)
92+
8193
if callBack is not None:
8294
self.llm.callBacks = [callBack]
8395

0 commit comments

Comments
 (0)