refactor: Update OpenAIModelComponent to handle optional model name and temperature
Update the OpenAIModelComponent to handle an optional model name and temperature. This allows for more flexibility in configuring the component. The model name can now be set to None if not provided, and the temperature can be set to 0.1 if not specified. This improves the usability and customization options of the OpenAIModelComponent.
This commit is contained in:
parent
909501e212
commit
3f3125de30
1 changed files with 2 additions and 2 deletions
|
|
@ -79,9 +79,9 @@ class OpenAIModelComponent(LCModelComponent):
|
|||
output = ChatOpenAI(
|
||||
max_tokens=max_tokens or None,
|
||||
model_kwargs=model_kwargs or {},
|
||||
model=model_name,
|
||||
model=model_name or None,
|
||||
base_url=openai_api_base,
|
||||
api_key=api_key,
|
||||
temperature=temperature,
|
||||
temperature=temperature or 0.1,
|
||||
)
|
||||
return output
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue