Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(go): fix bug where dev UI configs aren't respected #2234

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

huangjeff5
Copy link
Contributor

Tested manually in Dev UI.

@huangjeff5 huangjeff5 marked this pull request as ready for review March 4, 2025 18:01
@huangjeff5 huangjeff5 requested a review from apascal07 March 4, 2025 18:02
@@ -314,32 +315,50 @@ func generate(
return r, nil
}

func mapToStruct(m map[string]interface{}, v interface{}) error {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
func mapToStruct(m map[string]interface{}, v interface{}) error {
func mapToStruct(m map[string]any, v any) error {

gm.SetTopP(float32(c.TopP))
}
var c ai.GenerationCommonConfig
if err := mapToStruct(input.Config.(map[string]interface{}), &c); err != nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's not always a map though. It only comes in as a map if the request is from Dev UI. If you run a flow with a Generate call that has a config set, it will behave correctly. So this change is now breaking that I'm pretty sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: No status
Development

Successfully merging this pull request may close these issues.

2 participants