Skip to content

Commit

Permalink
Merge pull request #81 from codefuse-ai/fix74
Browse files Browse the repository at this point in the history
bufix: fix #74
  • Loading branch information
LewisLiu-code authored Nov 14, 2024
2 parents 80a5277 + 2acfd17 commit 176fc08
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion muagent/llm_models/openai_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def __init__(self, llm_config: LLMConfig, callBack: AsyncIteratorCallbackHandler
http_client=http_client,
timeout=120
)
else:
elif http_client:
self.llm = ChatOpenAI(
streaming=True,
verbose=True,
Expand All @@ -78,6 +78,18 @@ def __init__(self, llm_config: LLMConfig, callBack: AsyncIteratorCallbackHandler
timeout=120
# callbacks=[callBack],
)
else:
self.llm = ChatOpenAI(
streaming=True,
verbose=True,
api_key=llm_config.api_key,
model_name=llm_config.model_name,
base_url=llm_config.api_base_url,
temperature=llm_config.temperature,
model_kwargs={"stop": llm_config.stop},
timeout=120
)

if callBack is not None:
self.llm.callBacks = [callBack]

Expand Down

0 comments on commit 176fc08

Please sign in to comment.