@yaks/openai 0.0.0-stage → 0.2.36

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 (78) hide show
  1. package/LICENSE +202 -0
  2. package/README.md +389 -2
  3. package/_dist/batches.d.ts +77 -0
  4. package/_dist/batches.d.ts.map +1 -0
  5. package/_dist/credential.d.ts +13 -0
  6. package/_dist/credential.d.ts.map +1 -0
  7. package/_dist/images.d.ts +15 -0
  8. package/_dist/images.d.ts.map +1 -0
  9. package/_dist/list.d.ts +8 -0
  10. package/_dist/list.d.ts.map +1 -0
  11. package/_dist/media.d.ts +11 -0
  12. package/_dist/media.d.ts.map +1 -0
  13. package/_dist/mod.d.ts +30 -0
  14. package/_dist/mod.d.ts.map +1 -0
  15. package/_dist/project-keys.d.ts +4 -0
  16. package/_dist/project-keys.d.ts.map +1 -0
  17. package/_dist/provider.d.ts +48 -0
  18. package/_dist/provider.d.ts.map +1 -0
  19. package/_dist/responses.d.ts +51 -0
  20. package/_dist/responses.d.ts.map +1 -0
  21. package/_dist/transport.d.ts +121 -0
  22. package/_dist/transport.d.ts.map +1 -0
  23. package/_dist/vocab.d.ts +10 -0
  24. package/_dist/vocab.d.ts.map +1 -0
  25. package/batches.js +145 -0
  26. package/batches.js.map +1 -0
  27. package/batches.ts +194 -0
  28. package/credential.js +30 -0
  29. package/credential.js.map +1 -0
  30. package/credential.ts +40 -0
  31. package/deno.json +1 -0
  32. package/generations.js +288 -0
  33. package/generations.js.map +1 -0
  34. package/generations.ts +365 -0
  35. package/images.js +37 -0
  36. package/images.js.map +1 -0
  37. package/images.ts +63 -0
  38. package/info.js +55 -0
  39. package/info.js.map +1 -0
  40. package/info.ts +59 -0
  41. package/limits.js +50 -0
  42. package/limits.js.map +1 -0
  43. package/limits.ts +48 -0
  44. package/list.js +88 -0
  45. package/list.js.map +1 -0
  46. package/list.ts +127 -0
  47. package/mark.js +29 -0
  48. package/mark.js.map +1 -0
  49. package/mark.ts +50 -0
  50. package/media.js +60 -0
  51. package/media.js.map +1 -0
  52. package/media.ts +94 -0
  53. package/mod.js +28 -0
  54. package/mod.js.map +1 -0
  55. package/mod.ts +64 -0
  56. package/native.js +176 -0
  57. package/native.js.map +1 -0
  58. package/native.ts +221 -0
  59. package/package.json +36 -4
  60. package/project-keys.js +32 -0
  61. package/project-keys.js.map +1 -0
  62. package/project-keys.ts +43 -0
  63. package/provider.js +190 -0
  64. package/provider.js.map +1 -0
  65. package/provider.ts +292 -0
  66. package/reads.js +167 -0
  67. package/reads.js.map +1 -0
  68. package/reads.ts +169 -0
  69. package/responses.js +612 -0
  70. package/responses.js.map +1 -0
  71. package/responses.ts +706 -0
  72. package/transport.js +646 -0
  73. package/transport.js.map +1 -0
  74. package/transport.ts +972 -0
  75. package/vocab.js +23 -0
  76. package/vocab.js.map +1 -0
  77. package/vocab.json +25 -0
  78. package/vocab.ts +29 -0
package/vocab.js ADDED
@@ -0,0 +1,23 @@
1
+ // The component declaration, and nothing else: the module a server or a browser
2
+ // page imports at `@yaks/openai/vocab`. It reaches no storage, no SQL and no
3
+ // runtime, so a browser tab loading this vocabulary loads nothing else.
4
+ import doc from './vocab.json' with {
5
+ type: 'json'
6
+ };
7
+ import manifest from './package.json' with {
8
+ type: 'json'
9
+ };
10
+ /** The one comp this provider stamps on an ask it answered:
11
+ * `openai{response_id}`. Load it beside the conversation's vocabulary. */ export let openaiDoc = doc;
12
+ /** The reply an ask's `openai{response_id}` (or `name`'s, for a provider
13
+ * stamping its own) names, which a later request continues from where the
14
+ * provider stored it. */ export let responseAnchor = (comps, name = 'openai')=>{
15
+ let id = comps[name]?.response_id;
16
+ return typeof id == 'string' && id ? id : undefined;
17
+ };
18
+ /** What this package is: its manifest's description, the one place it is
19
+ * written, which a host stamps on each document here. */ export let description = manifest.description;
20
+ /** Every document this plugin declares. */ export let docs = [
21
+ openaiDoc
22
+ ];
23
+ //# sourceMappingURL=vocab.js.map
package/vocab.js.map ADDED
@@ -0,0 +1 @@
1
+ {"version":3,"file":"vocab.js","sources":["./vocab.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,6EAA6E;AAC7E,wEAAwE;AAGxE,OAAO,SAAS,oBAAoB;EAAE,MAAM;AAAO,EAAC;AACpD,OAAO,cAAc,sBAAsB;EAAE,MAAM;AAAO,EAAC;AAE3D;wEACwE,GACxE,OAAO,IAAI,YAAsB,IAAG;AAEpC;;uBAEuB,GACvB,OAAO,IAAI,iBAAiB,CAC1B,OACA,OAAO,QAAQ;EAEf,IAAI,KAAM,KAAK,CAAC,KAAK,EAA0C;EAC/D,OAAO,OAAO,MAAM,YAAY,KAAK,KAAK;AAC5C,EAAC;AAED;uDACuD,GACvD,OAAO,IAAI,cAAsB,SAAS,WAAW,CAAA;AAErD,yCAAyC,GACzC,OAAO,IAAI,OAAmB;EAAC;CAAU,CAAA"}
package/vocab.json ADDED
@@ -0,0 +1,25 @@
1
+ {
2
+ "$id": "urn:uuid:07399ffd-99d9-4a9b-b57c-2df26be2eafc",
3
+ "title": "openai",
4
+ "$defs": {
5
+ "openai": {
6
+ "$id": "urn:uuid:45090b06-11f3-49a5-b328-cc01ecc104c0",
7
+ "component": true,
8
+ "journal": false,
9
+ "type": "object",
10
+ "description": "what the Responses API keeps about an ask: the reply's id, which anchors a later request when the provider stored it",
11
+ "properties": {
12
+ "response_id": {
13
+ "$id": "urn:uuid:1fdb2c86-7ee7-4c39-84cc-f215110103f5",
14
+ "type": "string"
15
+ },
16
+ "cache_expires_at": {
17
+ "$id": "urn:uuid:c2f6ead1-4776-4372-a597-aa547e859b5c",
18
+ "type": "string",
19
+ "format": "date-time",
20
+ "description": "the recorded expiry of this request\u2019s cached prefix; provider-reported where present, otherwise request start plus documented provider retention. Missing means unknown, not warm"
21
+ }
22
+ }
23
+ }
24
+ }
25
+ }
package/vocab.ts ADDED
@@ -0,0 +1,29 @@
1
+ // The component declaration, and nothing else: the module a server or a browser
2
+ // page imports at `@yaks/openai/vocab`. It reaches no storage, no SQL and no
3
+ // runtime, so a browser tab loading this vocabulary loads nothing else.
4
+
5
+ import type { VocabDoc } from 'jsr:@yaks/vocab@0.2.36'
6
+ import doc from './vocab.json' with { type: 'json' }
7
+ import manifest from './package.json' with { type: 'json' }
8
+
9
+ /** The one comp this provider stamps on an ask it answered:
10
+ * `openai{response_id}`. Load it beside the conversation's vocabulary. */
11
+ export let openaiDoc: VocabDoc = doc
12
+
13
+ /** The reply an ask's `openai{response_id}` (or `name`'s, for a provider
14
+ * stamping its own) names, which a later request continues from where the
15
+ * provider stored it. */
16
+ export let responseAnchor = (
17
+ comps: Record<string, unknown>,
18
+ name = 'openai',
19
+ ): string | undefined => {
20
+ let id = (comps[name] as Record<string, unknown> | undefined)?.response_id
21
+ return typeof id == 'string' && id ? id : undefined
22
+ }
23
+
24
+ /** What this package is: its manifest's description, the one place it is
25
+ * written, which a host stamps on each document here. */
26
+ export let description: string = manifest.description
27
+
28
+ /** Every document this plugin declares. */
29
+ export let docs: VocabDoc[] = [openaiDoc]