@jutge.org/toolkit 4.2.33 → 4.2.34

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jutge.org/toolkit",
3
3
  "description": "Toolkit to prepare problems for Jutge.org",
4
- "version": "4.2.33",
4
+ "version": "4.2.34",
5
5
  "homepage": "https://jutge.org",
6
6
  "author": {
7
7
  "name": "Jutge.org",
package/toolkit/ask.ts CHANGED
@@ -6,6 +6,7 @@ import tui from '../lib/tui'
6
6
  import { projectDir, readTextInDir } from '../lib/utils'
7
7
  import { join } from 'path'
8
8
  import { all } from 'radash'
9
+ import { getLoggedInJutgeClient } from '../lib/login'
9
10
 
10
11
  export const askCmd = new Command('ask')
11
12
  .description('Ask questions about jutge-toolkit to JutgeAI')
@@ -14,12 +15,13 @@ export const askCmd = new Command('ask')
14
15
  .option('-m, --model <model>', 'AI model to use', settings.defaultModel)
15
16
 
16
17
  .action(async (question, { model }) => {
18
+ const jutge = await getLoggedInJutgeClient()
17
19
  const systemPrompt = await readTextInDir(join(projectDir(), 'assets', 'prompts', 'ask'), 'ask.md')
18
20
 
19
21
  const docs = await loadDocumentation() // Load your markdown files
20
22
  const fullPrompt = `${docs}\n\nUser question: ${question}`
21
23
 
22
- const answer = await complete(model, systemPrompt, fullPrompt)
24
+ const answer = await complete(jutge, model, systemPrompt, fullPrompt)
23
25
  await tui.markdown(answer)
24
26
  tui.warning(
25
27
  `This answer generated by JutgeAI using ${model} is not authoritative but we hope it will help you.`,