Skip to content

OpenAICUAClient.ts and AnthropicCUAClient.ts pass the whole clientOptions to the LLM constructor #644

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

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

Conversation

majkiw
Copy link

@majkiw majkiw commented Apr 7, 2025

why

#643

what changed

OpenAICUAClient now respects baseURL passed in the options

Copy link

changeset-bot bot commented Apr 7, 2025

🦋 Changeset detected

Latest commit: 4fdfea8

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@browserbasehq/stagehand Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

PR Summary

The changes update the OpenAICUAClient to read and apply the baseURL from clientOptions, aligning its behavior with AnthropicCUAClient.

  • In /lib/agent/OpenAICUAClient.ts, baseURL is extracted from clientOptions if provided.
  • The baseURL is injected into the clientOptions before initializing the OpenAI client.
  • This adjustment ensures consistency with AnthropicCUAClient for comprehensive client configuration.

💡 (1/5) You can manually trigger the bot by mentioning @greptileai in a comment!

1 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings | Greptile

@kamath
Copy link
Member

kamath commented Apr 7, 2025

Thanks so much for opening this PR! Ideally this would take the entire clientOptions type -- happy to take that on unless you want to add that to this PR

@majkiw majkiw force-pushed the STAGEHAND-643-base-url-for-openai branch from 27f6df7 to 4fdfea8 Compare April 8, 2025 08:33
@majkiw majkiw changed the title OpenAICUAClient.ts reads baseUrl from clientOptions OpenAICUAClient.ts and AnthropicCUAClient.ts pass the whole clientOptions to the LLM constructor Apr 8, 2025
@majkiw
Copy link
Author

majkiw commented Apr 8, 2025

Thanks @kamath!
I thought I'd add that, too, but I ran into some backward compatibility questions.
Probably better if I just pass it to you then.

As I mentioned in the issue, ideally, we would be able to pass the whole llmClient to support custom instrumentation for better observability (just like for the Stagehand constructor).

But for now, to unblock our pilot implementation, just that baseURL would be very helpful 🙏

};

if (this.baseURL) {
this.clientOptions.baseUrl = this.baseURL;
Copy link
Author

@majkiw majkiw Apr 8, 2025

Choose a reason for hiding this comment

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

This probably didn't work as it was setting baseUrl instead of baseURL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants