Skip to content

Commit f41a292

Browse files
authored
fix: rename observability methods (#147)
1 parent 2718137 commit f41a292

File tree

3 files changed

+21
-22
lines changed

3 files changed

+21
-22
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nevermined-io/payments",
3-
"version": "1.0.0-rc17",
3+
"version": "1.0.0-rc18",
44
"description": "Typescript SDK to interact with the Nevermined Payments Protocol",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/api/observability-api.ts

Lines changed: 18 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -334,9 +334,9 @@ export function calculateDummySongUsage(): HeliconeResponseConfig['usage'] {
334334
}
335335

336336
/**
337-
* Creates a ChatOpenAI configuration with Helicone logging enabled
337+
* Creates a ChatOpenAI configuration with logging enabled
338338
*
339-
* Usage: const llm = new ChatOpenAI(withHeliconeLangchain("gpt-4o-mini", apiKey, heliconeApiKey, heliconeBaseLoggingUrl, accountAddress, agentRequest, customProperties));
339+
* Usage: const llm = new ChatOpenAI(withLangchain("gpt-4o-mini", apiKey, heliconeApiKey, heliconeBaseLoggingUrl, accountAddress, agentRequest, customProperties));
340340
*
341341
* @param model - The OpenAI model to use (e.g., "gpt-4o-mini", "gpt-4")
342342
* @param apiKey - The OpenAI API key
@@ -346,9 +346,9 @@ export function calculateDummySongUsage(): HeliconeResponseConfig['usage'] {
346346
* @param environmentName - The environment name for logging purposes
347347
* @param agentRequest - The agent request for logging purposes
348348
* @param customProperties - Custom properties to add as Helicone headers
349-
* @returns Configuration object for ChatOpenAI constructor with Helicone enabled
349+
* @returns Configuration object for ChatOpenAI constructor with logging enabled
350350
*/
351-
export function withHeliconeLangchain(
351+
export function withLangchain(
352352
model: string,
353353
apiKey: string,
354354
heliconeApiKey: string,
@@ -377,9 +377,9 @@ export function withHeliconeLangchain(
377377
}
378378

379379
/**
380-
* Creates an OpenAI client configuration with Helicone logging enabled
380+
* Creates an OpenAI client configuration with logging enabled
381381
*
382-
* Usage: const openai = new OpenAI(withHeliconeOpenAI(apiKey, heliconeApiKey, heliconeBaseLoggingUrl, accountAddress, agentRequest, customProperties));
382+
* Usage: const openai = new OpenAI(withOpenAI(apiKey, heliconeApiKey, heliconeBaseLoggingUrl, accountAddress, agentRequest, customProperties));
383383
*
384384
* @param apiKey - The OpenAI API key
385385
* @param heliconeApiKey - The Helicone API key for logging
@@ -388,9 +388,9 @@ export function withHeliconeLangchain(
388388
* @param environmentName - The environment name for logging purposes
389389
* @param agentRequest - The agent request for logging purposes
390390
* @param customProperties - Custom properties to add as Helicone headers
391-
* @returns Configuration object for OpenAI constructor with Helicone enabled
391+
* @returns Configuration object for OpenAI constructor with logging enabled
392392
*/
393-
export function withHeliconeOpenAI(
393+
export function withOpenAI(
394394
apiKey: string,
395395
heliconeApiKey: string,
396396
heliconeBaseLoggingUrl: string,
@@ -486,23 +486,23 @@ export class ObservabilityAPI extends BasePaymentsAPI {
486486
}
487487

488488
/**
489-
* Creates a ChatOpenAI configuration with Helicone logging enabled
489+
* Creates a ChatOpenAI configuration with logging enabled
490490
*
491-
* Usage: const llm = new ChatOpenAI(observability.withHeliconeLangchain("gpt-4o-mini", apiKey, agentRequest, customProperties));
491+
* Usage: const llm = new ChatOpenAI(observability.withLangchain("gpt-4o-mini", apiKey, agentRequest, customProperties));
492492
*
493493
* @param model - The OpenAI model to use (e.g., "gpt-4o-mini", "gpt-4")
494494
* @param apiKey - The OpenAI API key
495495
* @param agentRequest - The agent request for logging purposes
496496
* @param customProperties - Custom properties to add as Helicone headers (should include agentid and sessionid)
497-
* @returns Configuration object for ChatOpenAI constructor with Helicone enabled
497+
* @returns Configuration object for ChatOpenAI constructor with logging enabled
498498
*/
499-
withHeliconeLangchain(
499+
withLangchain(
500500
model: string,
501501
apiKey: string,
502502
startAgentRequest: StartAgentRequest,
503503
customProperties: CustomProperties,
504504
): ChatOpenAIConfiguration {
505-
return withHeliconeLangchain(
505+
return withLangchain(
506506
model,
507507
apiKey,
508508
this.heliconeApiKey,
@@ -515,22 +515,21 @@ export class ObservabilityAPI extends BasePaymentsAPI {
515515
}
516516

517517
/**
518-
* Creates an OpenAI client configuration with Helicone logging enabled
518+
* Creates an OpenAI client configuration with logging enabled
519519
*
520-
* Usage: const openai = new OpenAI(observability.withHeliconeOpenAI(apiKey, heliconeApiKey, agentRequest, customProperties));
520+
* Usage: const openai = new OpenAI(observability.withOpenAI(apiKey, heliconeApiKey, agentRequest, customProperties));
521521
*
522522
* @param apiKey - The OpenAI API key
523-
* @param heliconeApiKey - The Helicone API key for logging
524523
* @param agentRequest - The agent request for logging purposes
525524
* @param customProperties - Custom properties to add as Helicone headers (should include agentid and sessionid)
526-
* @returns Configuration object for OpenAI constructor with Helicone enabled
525+
* @returns Configuration object for OpenAI constructor with logging enabled
527526
*/
528-
withHeliconeOpenAI(
527+
withOpenAI(
529528
apiKey: string,
530529
agentRequest: StartAgentRequest,
531530
customProperties: CustomProperties,
532531
): OpenAIConfiguration {
533-
return withHeliconeOpenAI(
532+
return withOpenAI(
534533
apiKey,
535534
this.heliconeApiKey,
536535
this.heliconeBaseLoggingUrl,

tests/unit/observability-api.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ describe('Observability-Api (unit)', () => {
2626
environment: 'custom',
2727
})
2828

29-
const cfg = payments.observability.withHeliconeOpenAI('sk-openai', agentRequest, {
29+
const cfg = payments.observability.withOpenAI('sk-openai', agentRequest, {
3030
agentid: 'test-agent',
3131
sessionid: 'test-session',
3232
})
@@ -45,7 +45,7 @@ describe('Observability-Api (unit)', () => {
4545
Environments.custom = { ...originalCustom, heliconeUrl: 'https://custom.helicone.com' }
4646

4747
const payments = Payments.getInstance({ nvmApiKey: nvmApiKeyHash, environment: 'custom' })
48-
const cfg = payments.observability.withHeliconeOpenAI('sk-openai', agentRequest, {
48+
const cfg = payments.observability.withOpenAI('sk-openai', agentRequest, {
4949
agentid: 'test-agent',
5050
sessionid: 'test-session',
5151
})

0 commit comments

Comments
 (0)