@canarycoders/ai 0.4.0 → 0.5.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.
package/README.md CHANGED
@@ -16,9 +16,9 @@ bun add @canarycoders/ai
16
16
  ## Quick start
17
17
 
18
18
  ```ts
19
- import CanaryLLM from "@canarycoders/ai";
19
+ import CanaryCodersAI from "@canarycoders/ai";
20
20
 
21
- const client = new CanaryLLM({ apiKey: process.env.CANARY_AI_API_KEY });
21
+ const client = new CanaryCodersAI({ apiKey: process.env.CANARY_AI_API_KEY });
22
22
 
23
23
  const res = await client.chat.complete({
24
24
  provider: "openai",
@@ -29,7 +29,7 @@ const res = await client.chat.complete({
29
29
  console.log(res.content, res.usage.totalTokens);
30
30
  ```
31
31
 
32
- `apiKey` defaults to `CANARY_AI_API_KEY` (legacy `CANARYLLM_API_KEY` still works) and `baseURL` to the hosted gateway, so `new CanaryLLM()` with the env var set is enough.
32
+ `apiKey` defaults to `CANARY_AI_API_KEY` (legacy `CANARYLLM_API_KEY` still works) and `baseURL` to the hosted gateway, so `new CanaryCodersAI()` with the env var set is enough.
33
33
 
34
34
  ## How the queue works
35
35
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compat.ts"],"names":[],"mappings":";;;AAgBA,SAAS,GAAG,OAAA,EAAyB;AACnC,EAAA,OAAO,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAC,CAAA,GAAA,CAAA;AACvC;AAEO,SAAS,YAAA,CAAa,SAAiB,MAAA,EAA8B;AAC1E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC;AAEO,SAAS,eAAA,CAAgB,SAAiB,MAAA,EAA8B;AAC7E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC","file":"compat.cjs","sourcesContent":["/**\n * Helpers to point the official OpenAI / Anthropic SDKs at CanaryLLM's\n * drop-in compatible endpoints. Use the `provider/modelId` model-string format\n * (e.g. `\"openai/gpt-4o-mini\"`, `\"anthropic/claude-sonnet-4-5\"`).\n *\n * @example\n * import OpenAI from \"openai\";\n * import { openaiTarget } from \"@canarycoders/ai/compat\";\n * const oa = new OpenAI(openaiTarget(baseURL, apiKey));\n */\nexport interface CompatTarget {\n baseURL: string;\n apiKey: string;\n defaultHeaders?: Record<string, string>;\n}\n\nfunction v1(baseURL: string): string {\n return `${baseURL.replace(/\\/+$/, \"\")}/v1`;\n}\n\nexport function openaiTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n\nexport function anthropicTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n"]}
1
+ {"version":3,"sources":["../src/compat.ts"],"names":[],"mappings":";;;AAgBA,SAAS,GAAG,OAAA,EAAyB;AACnC,EAAA,OAAO,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAC,CAAA,GAAA,CAAA;AACvC;AAEO,SAAS,YAAA,CAAa,SAAiB,MAAA,EAA8B;AAC1E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC;AAEO,SAAS,eAAA,CAAgB,SAAiB,MAAA,EAA8B;AAC7E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC","file":"compat.cjs","sourcesContent":["/**\n * Helpers to point the official OpenAI / Anthropic SDKs at CanaryCoders AI's\n * drop-in compatible endpoints. Use the `provider/modelId` model-string format\n * (e.g. `\"openai/gpt-4o-mini\"`, `\"anthropic/claude-sonnet-4-5\"`).\n *\n * @example\n * import OpenAI from \"openai\";\n * import { openaiTarget } from \"@canarycoders/ai/compat\";\n * const oa = new OpenAI(openaiTarget(baseURL, apiKey));\n */\nexport interface CompatTarget {\n baseURL: string;\n apiKey: string;\n defaultHeaders?: Record<string, string>;\n}\n\nfunction v1(baseURL: string): string {\n return `${baseURL.replace(/\\/+$/, \"\")}/v1`;\n}\n\nexport function openaiTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n\nexport function anthropicTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n"]}
package/dist/compat.d.cts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Helpers to point the official OpenAI / Anthropic SDKs at CanaryLLM's
2
+ * Helpers to point the official OpenAI / Anthropic SDKs at CanaryCoders AI's
3
3
  * drop-in compatible endpoints. Use the `provider/modelId` model-string format
4
4
  * (e.g. `"openai/gpt-4o-mini"`, `"anthropic/claude-sonnet-4-5"`).
5
5
  *
package/dist/compat.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Helpers to point the official OpenAI / Anthropic SDKs at CanaryLLM's
2
+ * Helpers to point the official OpenAI / Anthropic SDKs at CanaryCoders AI's
3
3
  * drop-in compatible endpoints. Use the `provider/modelId` model-string format
4
4
  * (e.g. `"openai/gpt-4o-mini"`, `"anthropic/claude-sonnet-4-5"`).
5
5
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/compat.ts"],"names":[],"mappings":";AAgBA,SAAS,GAAG,OAAA,EAAyB;AACnC,EAAA,OAAO,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAC,CAAA,GAAA,CAAA;AACvC;AAEO,SAAS,YAAA,CAAa,SAAiB,MAAA,EAA8B;AAC1E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC;AAEO,SAAS,eAAA,CAAgB,SAAiB,MAAA,EAA8B;AAC7E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC","file":"compat.js","sourcesContent":["/**\n * Helpers to point the official OpenAI / Anthropic SDKs at CanaryLLM's\n * drop-in compatible endpoints. Use the `provider/modelId` model-string format\n * (e.g. `\"openai/gpt-4o-mini\"`, `\"anthropic/claude-sonnet-4-5\"`).\n *\n * @example\n * import OpenAI from \"openai\";\n * import { openaiTarget } from \"@canarycoders/ai/compat\";\n * const oa = new OpenAI(openaiTarget(baseURL, apiKey));\n */\nexport interface CompatTarget {\n baseURL: string;\n apiKey: string;\n defaultHeaders?: Record<string, string>;\n}\n\nfunction v1(baseURL: string): string {\n return `${baseURL.replace(/\\/+$/, \"\")}/v1`;\n}\n\nexport function openaiTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n\nexport function anthropicTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n"]}
1
+ {"version":3,"sources":["../src/compat.ts"],"names":[],"mappings":";AAgBA,SAAS,GAAG,OAAA,EAAyB;AACnC,EAAA,OAAO,CAAA,EAAG,OAAA,CAAQ,OAAA,CAAQ,MAAA,EAAQ,EAAE,CAAC,CAAA,GAAA,CAAA;AACvC;AAEO,SAAS,YAAA,CAAa,SAAiB,MAAA,EAA8B;AAC1E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC;AAEO,SAAS,eAAA,CAAgB,SAAiB,MAAA,EAA8B;AAC7E,EAAA,OAAO,EAAE,OAAA,EAAS,EAAA,CAAG,OAAO,GAAG,MAAA,EAAO;AACxC","file":"compat.js","sourcesContent":["/**\n * Helpers to point the official OpenAI / Anthropic SDKs at CanaryCoders AI's\n * drop-in compatible endpoints. Use the `provider/modelId` model-string format\n * (e.g. `\"openai/gpt-4o-mini\"`, `\"anthropic/claude-sonnet-4-5\"`).\n *\n * @example\n * import OpenAI from \"openai\";\n * import { openaiTarget } from \"@canarycoders/ai/compat\";\n * const oa = new OpenAI(openaiTarget(baseURL, apiKey));\n */\nexport interface CompatTarget {\n baseURL: string;\n apiKey: string;\n defaultHeaders?: Record<string, string>;\n}\n\nfunction v1(baseURL: string): string {\n return `${baseURL.replace(/\\/+$/, \"\")}/v1`;\n}\n\nexport function openaiTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n\nexport function anthropicTarget(baseURL: string, apiKey: string): CompatTarget {\n return { baseURL: v1(baseURL), apiKey };\n}\n"]}
package/dist/index.cjs CHANGED
@@ -1594,7 +1594,7 @@ function readEnv(key) {
1594
1594
  if (typeof process !== "undefined" && process.env) return process.env[key];
1595
1595
  return void 0;
1596
1596
  }
1597
- var CanaryLLM = class {
1597
+ var CanaryCodersAI = class {
1598
1598
  chat;
1599
1599
  queue;
1600
1600
  images;
@@ -1653,14 +1653,15 @@ var CanaryLLM = class {
1653
1653
  };
1654
1654
 
1655
1655
  // src/index.ts
1656
- var src_default = CanaryLLM;
1656
+ var src_default = CanaryCodersAI;
1657
1657
 
1658
1658
  exports.APIConnectionError = APIConnectionError;
1659
1659
  exports.APIConnectionTimeoutError = APIConnectionTimeoutError;
1660
1660
  exports.APIError = APIError;
1661
1661
  exports.AuthenticationError = AuthenticationError;
1662
1662
  exports.BadRequestError = BadRequestError;
1663
- exports.CanaryLLM = CanaryLLM;
1663
+ exports.CanaryCodersAI = CanaryCodersAI;
1664
+ exports.CanaryLLM = CanaryCodersAI;
1664
1665
  exports.ConflictError = ConflictError;
1665
1666
  exports.InternalServerError = InternalServerError;
1666
1667
  exports.Job = Job;