@jupyterlite/ai 0.2.0 → 0.4.0

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.
Files changed (66) hide show
  1. package/README.md +48 -9
  2. package/lib/chat-handler.d.ts +15 -3
  3. package/lib/chat-handler.js +80 -28
  4. package/lib/completion-provider.d.ts +5 -18
  5. package/lib/completion-provider.js +8 -34
  6. package/lib/icons.d.ts +2 -0
  7. package/lib/icons.js +15 -0
  8. package/lib/index.d.ts +3 -2
  9. package/lib/index.js +79 -22
  10. package/lib/llm-models/anthropic-completer.d.ts +19 -0
  11. package/lib/llm-models/anthropic-completer.js +57 -0
  12. package/lib/llm-models/base-completer.d.ts +6 -2
  13. package/lib/llm-models/chrome-completer.d.ts +19 -0
  14. package/lib/llm-models/chrome-completer.js +67 -0
  15. package/lib/llm-models/codestral-completer.d.ts +9 -8
  16. package/lib/llm-models/codestral-completer.js +37 -54
  17. package/lib/llm-models/index.d.ts +3 -2
  18. package/lib/llm-models/index.js +42 -2
  19. package/lib/llm-models/openai-completer.d.ts +19 -0
  20. package/lib/llm-models/openai-completer.js +51 -0
  21. package/lib/provider.d.ts +54 -15
  22. package/lib/provider.js +123 -41
  23. package/lib/settings/instructions.d.ts +2 -0
  24. package/lib/settings/instructions.js +44 -0
  25. package/lib/settings/panel.d.ts +70 -0
  26. package/lib/settings/panel.js +190 -0
  27. package/lib/settings/schemas/_generated/Anthropic.json +70 -0
  28. package/lib/settings/schemas/_generated/ChromeAI.json +21 -0
  29. package/lib/settings/schemas/_generated/MistralAI.json +75 -0
  30. package/lib/settings/schemas/_generated/OpenAI.json +668 -0
  31. package/lib/settings/schemas/base.json +7 -0
  32. package/lib/settings/schemas/index.d.ts +3 -0
  33. package/lib/settings/schemas/index.js +11 -0
  34. package/lib/slash-commands.d.ts +16 -0
  35. package/lib/slash-commands.js +25 -0
  36. package/lib/tokens.d.ts +103 -0
  37. package/lib/tokens.js +5 -0
  38. package/package.json +27 -104
  39. package/schema/chat.json +8 -0
  40. package/schema/provider-registry.json +17 -0
  41. package/src/chat-handler.ts +103 -43
  42. package/src/completion-provider.ts +13 -37
  43. package/src/icons.ts +18 -0
  44. package/src/index.ts +101 -24
  45. package/src/llm-models/anthropic-completer.ts +75 -0
  46. package/src/llm-models/base-completer.ts +7 -2
  47. package/src/llm-models/chrome-completer.ts +88 -0
  48. package/src/llm-models/codestral-completer.ts +43 -69
  49. package/src/llm-models/index.ts +49 -2
  50. package/src/llm-models/openai-completer.ts +67 -0
  51. package/src/llm-models/svg.d.ts +9 -0
  52. package/src/provider.ts +138 -43
  53. package/src/settings/instructions.ts +48 -0
  54. package/src/settings/panel.tsx +257 -0
  55. package/src/settings/schemas/index.ts +15 -0
  56. package/src/slash-commands.tsx +55 -0
  57. package/src/tokens.ts +112 -0
  58. package/style/base.css +4 -0
  59. package/style/icons/jupyternaut-lite.svg +7 -0
  60. package/lib/llm-models/utils.d.ts +0 -15
  61. package/lib/llm-models/utils.js +0 -29
  62. package/lib/token.d.ts +0 -13
  63. package/lib/token.js +0 -2
  64. package/schema/ai-provider.json +0 -21
  65. package/src/llm-models/utils.ts +0 -41
  66. package/src/token.ts +0 -19
@@ -0,0 +1,75 @@
1
+ {
2
+ "$schema": "http://json-schema.org/draft-07/schema#",
3
+ "type": "object",
4
+ "properties": {
5
+ "streamUsage": {
6
+ "type": "boolean",
7
+ "description": "Whether or not to include token usage in the stream.",
8
+ "default": true
9
+ },
10
+ "disableStreaming": {
11
+ "type": "boolean",
12
+ "description": "Whether to disable streaming.\n\nIf streaming is bypassed, then `stream()` will defer to `invoke()`.\n\n- If true, will always bypass streaming case.\n- If false (default), will always use streaming case if available."
13
+ },
14
+ "apiKey": {
15
+ "type": "string",
16
+ "description": "The API key to use.",
17
+ "default": ""
18
+ },
19
+ "modelName": {
20
+ "type": "string",
21
+ "description": "The name of the model to use. Alias for `model`",
22
+ "default": "mistral-small-latest"
23
+ },
24
+ "model": {
25
+ "type": "string",
26
+ "description": "The name of the model to use.",
27
+ "default": "mistral-small-latest"
28
+ },
29
+ "endpoint": {
30
+ "type": "string",
31
+ "description": "Override the default endpoint."
32
+ },
33
+ "temperature": {
34
+ "type": "number",
35
+ "description": "What sampling temperature to use, between 0.0 and 2.0. Higher values like 0.8 will make the output more random, while lower values like 0.2 will make it more focused and deterministic.",
36
+ "default": 0.7
37
+ },
38
+ "topP": {
39
+ "type": "number",
40
+ "description": "Nucleus sampling, where the model considers the results of the tokens with `top_p` probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. Should be between 0 and 1.",
41
+ "default": 1
42
+ },
43
+ "maxTokens": {
44
+ "type": "number",
45
+ "description": "The maximum number of tokens to generate in the completion. The token count of your prompt plus max_tokens cannot exceed the model's context length."
46
+ },
47
+ "streaming": {
48
+ "type": "boolean",
49
+ "description": "Whether or not to stream the response.",
50
+ "default": false
51
+ },
52
+ "safeMode": {
53
+ "type": "boolean",
54
+ "description": "Whether to inject a safety prompt before all conversations.",
55
+ "default": false,
56
+ "deprecated": "use safePrompt instead"
57
+ },
58
+ "safePrompt": {
59
+ "type": "boolean",
60
+ "description": "Whether to inject a safety prompt before all conversations.",
61
+ "default": false
62
+ },
63
+ "randomSeed": {
64
+ "type": "number",
65
+ "description": "The seed to use for random sampling. If set, different calls will generate deterministic results. Alias for `seed`"
66
+ },
67
+ "seed": {
68
+ "type": "number",
69
+ "description": "The seed to use for random sampling. If set, different calls will generate deterministic results."
70
+ }
71
+ },
72
+ "additionalProperties": false,
73
+ "description": "Input to chat model class.",
74
+ "definitions": {}
75
+ }