You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: snippets/ai/README.md
+4-6Lines changed: 4 additions & 6 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
# AI Command Snippets
1
+
# AI Snippets for mongosh
2
2
3
3
> [!CAUTION]
4
4
> This is an experimental, early-stage snippet that is not meant for production use.
@@ -9,11 +9,9 @@ This snippet adds a suite of commands accessible with the `ai` command. This inc
9
9
|---------|-------------|---------|
10
10
|`ai.ask`| Ask questions about MongoDB |`ai.ask how do I run queries in mongosh?`|
11
11
|`ai.data`| Generate data-related mongosh commands |`ai.data insert some sample user info`|
12
-
|`ai.query`| Generate a MongoDB query |`ai.query find documents where name = "Ada"`|
13
-
|`ai.aggregate`| Generate a MongoDB aggregation |`ai.aggregate find documents where name = "Ada"`|
14
-
|`ai.collection`| Set the active collection |`ai.collection("users")`|
15
-
|`ai.shell`| Generate general mongosh commands |`ai.shell get sharding info`|
16
-
| `ai.general` | Ask general questions to your model | `ai.general what is the meaning of life?`
12
+
|`ai.query`| Generate a MongoDB query or aggregation |`ai.query find documents where name = "Ada"`|
13
+
|`ai.collection`| Set the active collection |`ai.collection users`|
14
+
|`ai.command`| Generate general mongosh commands _alias:_`ai.cmd`|`ai.command get sharding info`|
17
15
|`ai.config`| Configure the AI commands |`ai.config.set("provider", "ollama")`|
18
16
19
17
This currently supports 5 different AI providers: `docs, openai | mistral | atlas | ollama` and any model they support. For cloud providers, you can specify the API key with `MONGOSH_AI_API_KEY`.
Copy file name to clipboardExpand all lines: snippets/ai/src/providers/models.ts
+2-4Lines changed: 2 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -8,9 +8,7 @@ export const models = {
8
8
baseURL: 'https://knowledge.mongodb.com/api/v1',
9
9
apiKey: '',
10
10
headers: {
11
-
// TODO: Change to actual origin
12
11
'X-Request-Origin': 'mongodb-compass',
13
-
origin: 'mongodb-compass',
14
12
'user-agent':
15
13
'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) MongoDBCompass/1.47.0 Chrome/138.0.7204.251 Electron/37.6.0 Safari/537.36',
0 commit comments