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

feat(playground): tool call backend #5027

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

axiomofjoy
Copy link
Contributor

@axiomofjoy axiomofjoy commented Oct 16, 2024

  • records tool and tool calls in playground spans
  • implements union return type for subscription chunks to incrementally return tool calls in addition to text chunks

Screenshot 2024-10-15 at 6 46 17 PM

Screenshot 2024-10-15 at 6 46 33 PM

resolves #4988

@axiomofjoy axiomofjoy changed the base branch from main to playground October 16, 2024 01:14
@axiomofjoy axiomofjoy changed the title fix(playground): plumb through tool calls fix(playground): tool call backend Oct 16, 2024
@axiomofjoy axiomofjoy marked this pull request as ready for review October 16, 2024 01:49
@dosubot dosubot bot added the size:L This PR changes 100-499 lines, ignoring generated files. label Oct 16, 2024
@axiomofjoy axiomofjoy changed the title fix(playground): tool call backend feat(playground): tool call backend Oct 16, 2024
Comment on lines +65 to +73
class FunctionCallChunk:
name: str
arguments: str


@strawberry.type
class ToolCallChunk:
id: str
function: FunctionCallChunk
Copy link
Contributor

Choose a reason for hiding this comment

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

is the function field actually being chunked? or are you just yielding a toolcallchunk with the function field growing each time? That is, is there nested chunking happening here? If not the naming might be a bit confusing but i don't have a better thought, this is probably fine just curious of the mechanics

Copy link
Contributor Author

Choose a reason for hiding this comment

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

just the arguments being chunked. could call it just FunctionCall?

Copy link
Contributor

Choose a reason for hiding this comment

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

That could work, or just leaving it as is. Either way works for me just a small thing that occurred to me when reading, your call!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think these types might change when we do the mutation for non-streaming. Going to leave as is for now, I think it probably changes.

@axiomofjoy axiomofjoy merged commit 5485c03 into playground Oct 16, 2024
30 checks passed
@axiomofjoy axiomofjoy deleted the xander/playground-tool-calls branch October 16, 2024 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:L This PR changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[playground][gql] model tool calling parameters
2 participants