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:
ogabrielluiz 2024-06-13 10:42:27 -03:00
commit 3f3125de30

View file

@ -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