-
Notifications
You must be signed in to change notification settings - Fork 384
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(firestore-bigquery-export): Add Gemini agent to gen-schema-view #2242
base: next
Are you sure you want to change the base?
Conversation
firestore-bigquery-export/scripts/gen-schema-view/src/schema/index.ts
Outdated
Show resolved
Hide resolved
TestingDeeply Nested Documents: No explicit test cases for collections with deeply nested fields, such as maps within arrays or arrays within maps. Large Collections There are no tests for large collections that exceed the test("should handle collections with more than 100 documents", async () => {
const largeSampleData = Array.from({ length: 200 }, (_, i) => ({ id: i, value: `doc${i}` }));
const response = await runAgent(apiKey, "./schemas", "large_collection", "test_table", largeSampleData);
expect(response).toBeDefined();
expect(response.success).toBeTruthy();
}); |
I think i'll leave these out, they're fair points but not relevant to this PR in particular. Actually the "Large Collections" comment isn't correct; we're taking just a sample |
The current tests seem to be missing a verification for whether the sampling behavior correctly handles large collections. The tests should explicitly check that only the specified number of samples (agent-sample-size) are being processed, regardless of the total size of the collection. What I wrote should be like this instead (apologies):
|
|
||
```bash | ||
# Interactive mode | ||
npx @firebaseextensions/fs-bq-schema-views |
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.
I think its better to include a copy-paste minimal usage here, e.g. add --use-gemini-agent
and other required params
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.
We have a non-interactive example below, can you explain what you mean? confused
config.schemas[schemaName] | ||
); | ||
|
||
if (config.useGemini) { |
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.
should we check if the schema file already exist and exit?
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.
yes, good catch
Co-authored-by: Mais Alheraki <[email protected]>
This PR adds the option to use a Gemini Agent to generate the schema files, fixes some tests, and corrects a parameter description.