Skip to content

Commit afb70a4

Browse files
committed
chore: address pr comments
1 parent fe86ae6 commit afb70a4

2 files changed

Lines changed: 12 additions & 11 deletions

File tree

src/custom/CortiClient.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { CortiClient as BaseCortiClient } from "../Client.js";
2-
import type * as environments from "../environments.js";
32
import * as core from "../core/index.js";
4-
import { CortiAuth } from "./auth/CortiAuth.js";
3+
import type * as environments from "../environments.js";
54
import { CustomAgents } from "./agents/CustomAgents.js";
5+
import { CortiAuth } from "./auth/CortiAuth.js";
66
import { CustomStream } from "./stream/CustomStream.js";
77
import { CustomTranscribe } from "./transcribe/CustomTranscribe.js";
88
import { authToBaseOptions } from "./utils/authToBaseOptions.js";
@@ -93,14 +93,10 @@ export class CortiClient extends BaseCortiClient {
9393

9494
public getAuthHeaders = async (): Promise<Headers> => {
9595
const req = await this._options.authProvider.getAuthRequest();
96-
96+
9797
return new Headers({
9898
...(req.headers ?? {}),
9999
"Tenant-Name": await core.Supplier.get(this._options.tenantName),
100100
});
101101
};
102-
103-
/**
104-
* Patch: removed `auth` getter
105-
*/
106102
}

src/custom/agents/CustomAgents.ts

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* All the patches marked with `// Patch: ...` comments.
77
*/
88

9-
import { AgentsClient } from "../../api/resources/agents/client/Client.js";
9+
import { AgentsClient } from "../../api/resources/agents/client/Client.js";
1010
import * as core from "../../core/index.js";
1111

1212
export class CustomAgents extends AgentsClient {
@@ -15,12 +15,17 @@ export class CustomAgents extends AgentsClient {
1515
*
1616
* Returns the URL for the agent card JSON file.
1717
*
18-
* @param {string} agentId - The ID of the agentW
18+
* @param {string} agentId - The ID of the agent
1919
* @returns {Promise<URL>} The URL for the agent card
2020
*
2121
* @example
2222
* const url = await client.agents.getAgentCardUrl("agent-123");
2323
*/
24-
public getCardUrl = async (agentId: string): Promise<URL> =>
25-
new URL(`/agents/${agentId}/agent-card.json`, (await core.Supplier.get(this._options.environment)).agents);
24+
public getCardUrl = async (agentId: string): Promise<URL> => {
25+
const encodedAgentId = encodeURIComponent(agentId);
26+
return new URL(
27+
`/agents/${encodedAgentId}/agent-card.json`,
28+
(await core.Supplier.get(this._options.environment)).agents,
29+
);
30+
};
2631
}

0 commit comments

Comments
 (0)