Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

feat: add ai snippets #12

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

Draft
wants to merge 19 commits into
base: main
Choose a base branch
from
Draft

feat: add ai snippets #12

wants to merge 19 commits into from

Conversation

gagik
Copy link

@gagik gagik commented May 20, 2025

This is still code that is largely skunkworks-quality so will probably go through a couple more refactors before it's ready to be reviewed / merged but it's quite functional!

One can install this snippet using the snippet command in mongosh:

# Set your snippet sources
config.set('snippetIndexSourceURLs', config.get('snippetIndexSourceURLs') +
'; https://github.com/gagik/mongosh-snippets/raw/refs/heads/ai/index.bson.br'
 )
# Install the ai snippet
snippet install ai
# Check out the commands!
ai.help

@gagik gagik marked this pull request as draft May 20, 2025 11:31
Copy link
Collaborator

Choose a reason for hiding this comment

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

Keep in mind that this package-lock file has no practical effect 🙂

const { getAiSdkProvider, models } = localRequire<typeof import('./providers/generic/ai-sdk-provider.js')>('./providers/generic/ai-sdk-provider.js');
const { Config } = localRequire<typeof import('./config.js')>('./config.js');
const { wrapAllFunctions } = localRequire<typeof import('./helpers.js')>('./helpers.js');
const chalk = localRequire<typeof import('chalk')>('chalk');
Copy link
Collaborator

Choose a reason for hiding this comment

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

You shouldn't need localRequire in any file except the main entry point (index.js)

gagik and others added 2 commits May 20, 2025 13:54
Co-authored-by: Anna Henningsen <github@addaleax.net>
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