@betterlu/agentlu 1.2.0 → 1.2.1

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/dist/index.d.ts CHANGED
@@ -116,7 +116,11 @@ export declare class AgentLu {
116
116
  person?: string | null;
117
117
  defaults?: ClientDefaults;
118
118
  }): UseCaseRunner;
119
- /** Register a use-case client and resolve to its api key. */
119
+ /**
120
+ * Register a use-case client and resolve to its api key. The key is cached
121
+ * on this instance (same semantics as `register`), so a following
122
+ * `responses.create` is authorized.
123
+ */
120
124
  useCaseClient(name: string, opts?: {
121
125
  person?: string | null;
122
126
  defaults?: ClientDefaults;
package/dist/index.js CHANGED
@@ -55,11 +55,16 @@ export class AgentLu {
55
55
  useCase(name, opts) {
56
56
  return new UseCaseRunner(this, name, opts);
57
57
  }
58
- /** Register a use-case client and resolve to its api key. */
58
+ /**
59
+ * Register a use-case client and resolve to its api key. The key is cached
60
+ * on this instance (same semantics as `register`), so a following
61
+ * `responses.create` is authorized.
62
+ */
59
63
  async useCaseClient(name, opts) {
60
64
  const res = await this.request("POST", "/clients", { name, ...opts }, { auth: false });
61
65
  if (!res.api_key)
62
66
  throw new AgentLuError(500, "internal_error", "register returned no key", true);
67
+ this.apiKey = res.api_key;
63
68
  return res.api_key;
64
69
  }
65
70
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@betterlu/agentlu",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Client for the agentlu service API (/v1). Or just use the openai SDK pointed at http://localhost:8912/v1.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",