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

Replace Part layout to use enum instead of bool. For future adding of a Tool kind. #148

Merged
merged 3 commits into from
May 13, 2024

Conversation

randall77
Copy link
Contributor

Add Tool support to googleai.
Added ToolRequest and ToolResponse as possible Parts in a Document.

Add Tool cases to JSON marshaler/unmarshaler.
I don't think this is correct with respect to the javascript frontend,
but it at least does something reasonable for now.

@randall77 randall77 requested a review from jba May 13, 2024 15:40
// NewToolResponsePart returns a Part containing the results
// of applying a Tool that the model requested.
func NewToolResponsePart(r *ToolResponse) *Part {
return &Part{kind: partToolResponse, toolResponse: r}
}

// IsText reports whether the [Part] contains plain text.
func (p *Part) IsPlainText() bool {
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be IsText to match the others.

For future adding of a Tool kind.

Add Tool support to googleai.
Added ToolRequest and ToolResponse as possible Parts in a Document.

Add Tool cases to JSON marshaler/unmarshaler.
I don't think this is correct with respect to the javascript frontend,
but it at least does something reasonable for now.
(that caching won't work for more than one use of the generator).
@randall77 randall77 merged commit 068a543 into main May 13, 2024
5 checks passed
@randall77 randall77 deleted the khr-work16 branch May 13, 2024 20:07
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