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: move source of truth of example_test and add code generator #164

Merged
merged 1 commit into from
Jul 11, 2024
Merged

Conversation

eliben
Copy link
Member

@eliben eliben commented Jul 9, 2024

We'd like to automatically extract code snippets from our examples for the official documentation; the documentation tooling extracts code snippets delineated with special [START... and [END... markers.

However, we also want our examples to appear on the pkgsite without these special comments.

Therefore, the source of truth for example_test is moved to an internal directory from which snippets will be extracted; a tool processes this file to remove these special comments before placing it in genai/example_test.go

One snippet is added as an example - context window reporting for tokens

We'd like to automatically extract code snippets from our examples for
the official documentation; the documentation tooling extracts code
snippets delineated with special [START... and [END... markers.

However, we also want our examples to appear on the pkgsite without these
special comments.

Therefore, the source of truth for example_test is moved to an internal
directory from which snippets will be extracted; a tool processes this
file to remove these special comments before placing it in genai/example_test.go
@eliben eliben requested a review from jba July 9, 2024 21:25
@eliben eliben merged commit 07bb9dc into main Jul 11, 2024
2 checks passed
@eliben eliben deleted the snp branch July 11, 2024 01:17
eliben added a commit that referenced this pull request Jul 11, 2024
Follow up on #164

---------

Co-authored-by: Jonathan Amsterdam <jba@users.noreply.github.com>
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