-
Notifications
You must be signed in to change notification settings - Fork 11k
[AI GATEWAY] Generate code examples dynamically #27250
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
base: production
Are you sure you want to change the base?
Conversation
|
This PR requires additional review attention because it affects the following areas: PartialsThis PR updates partial files, which are pieces of content used across multiple files in our Render component.
|
kodster28
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few things here:
- we want to keep
.tsxand.astrofiles insrc/components/ - Also, testing it out on a few of the samples and it doesn't seem to work correctly.
- Generally -- and this is part of our ongoing code orange work -- we want to avoid react in the components that are used in our docs. Assuming that these can be built out more natively in either Astro-native language or in more vanilla JS.
I can change all the code to vanilla js and move it in src/components but can you tell me what's not working, these are the two examples I changed and every combination seemed to be working https://palash-aig-examples-exp.preview.developers.cloudflare.com/ai-gateway/get-started/#example |
Summary
AI Gateway can be configured in a bunch of ways:
Right now it's pretty hard for folks to take the small sample snippets we have and adapt them to their exact combo. This PR tries a madlib style, natural language form that generates the right code snippet based on what you pick.
(Since
Codecomponent is server-rendered, the generator is put together with a bit of a hack to wire everything up.)