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

genai: add samples for caching #186

Merged
merged 1 commit into from
Jul 19, 2024
Merged

genai: add samples for caching #186

merged 1 commit into from
Jul 19, 2024

Conversation

eliben
Copy link
Member

@eliben eliben commented Jul 19, 2024

No description provided.

@eliben eliben requested a review from jba July 19, 2024 17:20
@eliben
Copy link
Member Author

eliben commented Jul 19, 2024

Note the userContent function, it makes it makes it much nicer to create simple contents, e.g.

instead of:

x = *genai.Content{Role: "user", Parts: []genai.Part{genai.Text{"foo"}}}

one can write:

x = userContent(genai.Text{"foo"}}

In lanchgaingo there's an exported function that does this, and it's very convenient for users.

I'm wondering whether we should have such a function exported from the SDK as well

@jba
Copy link
Collaborator

jba commented Jul 19, 2024

Sure, maybe NewUserContent.

@eliben
Copy link
Member Author

eliben commented Jul 19, 2024

Sure, maybe NewUserContent.

OK, going to submit this as is and add that function in a separate PR where I'll also try to find locations where to apply it

@eliben eliben merged commit 55b6ca4 into main Jul 19, 2024
2 checks passed
@eliben eliben deleted the samp-cache branch July 19, 2024 18:27
@eliben eliben restored the samp-cache branch July 19, 2024 18:47
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