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

better manage types from LLM return calls #101

Open
filip-michalsky opened this issue Oct 10, 2024 · 1 comment
Open

better manage types from LLM return calls #101

filip-michalsky opened this issue Oct 10, 2024 · 1 comment
Labels
enhancement New feature or request
Milestone

Comments

@filip-michalsky
Copy link
Collaborator

hey stagehand team, seeing a few methods return an any type -- this isn't good practice; esp in like the LLM client where you return instead of just a string for message responses.

@filip-michalsky
Copy link
Collaborator Author

specifically in the lines i posted upthread, the line response.choices[0].message.tool_calls; is coming from the response generated by llmClient.createChatCompletion, not openai specifically, which can cause downstream errors.
My suggestion here would be to have createChatCompletion return a Promise containing the chat output (unless you want to have pricing information or whatever but that can be captured in logging, idk separate conversation). You can also have a callTool method that also returns a string but processes tool calling depending on the provider.
That way, if a client downstream wants to use ollama, perplexity, or any other API provider, they can just plug and play themselves easily if they implement their own llmClient

@filip-michalsky filip-michalsky added the enhancement New feature or request label Nov 4, 2024
@kamath kamath added this to Stagehand Nov 29, 2024
@kamath kamath added this to the Foundation milestone Nov 29, 2024
@kamath kamath moved this to Todo in Stagehand Nov 29, 2024
@kamath kamath removed the status in Stagehand Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: No status
Development

No branches or pull requests

2 participants