File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import { CortiClient as BaseCortiClient } from "../Client.js" ;
2- import type * as environments from "../environments.js" ;
32import * as core from "../core/index.js" ;
4- import { CortiAuth } from "./auth/CortiAuth .js" ;
3+ import type * as environments from "../environments .js" ;
54import { CustomAgents } from "./agents/CustomAgents.js" ;
5+ import { CortiAuth } from "./auth/CortiAuth.js" ;
66import { CustomStream } from "./stream/CustomStream.js" ;
77import { CustomTranscribe } from "./transcribe/CustomTranscribe.js" ;
88import { 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}
Original file line number Diff line number Diff line change 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" ;
1010import * as core from "../../core/index.js" ;
1111
1212export 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}
You can’t perform that action at this time.
0 commit comments