🐛 fix: Correct Model Parameters Merging and Panel UI (#5038)

* fix: Model Panel, watching wrong form field

* fix: Refactor agent initialization to merge model parameters correctly
This commit is contained in:
Danny Avila 2024-12-18 13:53:59 -05:00 committed by GitHub
parent 000641c619
commit f873587e5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 35 additions and 15 deletions

View file

@ -97,12 +97,15 @@ const initializeAgentOptions = async ({
agent.endpoint = provider.toLowerCase();
}
const model_parameters = agent.model_parameters ?? { model: agent.model };
const _endpointOption = isInitialAgent
? endpointOption
: {
model_parameters,
};
const model_parameters = Object.assign(
{},
agent.model_parameters ?? { model: agent.model },
isInitialAgent === true ? endpointOption?.model_parameters : {},
);
const _endpointOption =
isInitialAgent === true
? Object.assign({}, endpointOption, { model_parameters })
: { model_parameters };
const options = await getOptions({
req,