@rheonic/sdk 0.1.0-beta.7 → 0.1.0-beta.8
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/client.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export declare class Client {
|
|
|
42
42
|
private warmupCompleted;
|
|
43
43
|
constructor(config: ClientConfig);
|
|
44
44
|
captureEvent(event: EventPayload): Promise<void>;
|
|
45
|
+
captureEventAndFlush(event: EventPayload): Promise<void>;
|
|
45
46
|
getStats(): ClientStats;
|
|
46
47
|
flush(): Promise<void>;
|
|
47
48
|
evaluateProtectDecision(context: ProtectContext): Promise<ProtectEvaluation>;
|
package/dist/client.js
CHANGED
|
@@ -48,7 +48,7 @@ export function instrumentAnthropic(anthropicClient, options) {
|
|
|
48
48
|
markClampAppliedIfChanged(protectDecision, extractMaxOutputTokens(args), extractMaxOutputTokens(callArgs));
|
|
49
49
|
try {
|
|
50
50
|
const response = await originalCreate(...callArgs);
|
|
51
|
-
|
|
51
|
+
await options.client.captureEventAndFlush(buildEvent({
|
|
52
52
|
provider: "anthropic",
|
|
53
53
|
model: extractResponseModel(response) ?? requestedModel,
|
|
54
54
|
environment: options.environment ?? options.client.environment,
|
|
@@ -69,7 +69,7 @@ export function instrumentAnthropic(anthropicClient, options) {
|
|
|
69
69
|
return response;
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
72
|
-
|
|
72
|
+
await options.client.captureEventAndFlush(buildEvent({
|
|
73
73
|
provider: "anthropic",
|
|
74
74
|
model: requestedModel,
|
|
75
75
|
environment: options.environment ?? options.client.environment,
|
|
@@ -48,7 +48,7 @@ export function instrumentGoogle(googleModel, options) {
|
|
|
48
48
|
markClampAppliedIfChanged(protectDecision, extractMaxOutputTokens(args), extractMaxOutputTokens(callArgs));
|
|
49
49
|
try {
|
|
50
50
|
const response = await originalGenerate(...callArgs);
|
|
51
|
-
|
|
51
|
+
await options.client.captureEventAndFlush(buildEvent({
|
|
52
52
|
provider: "google",
|
|
53
53
|
model: requestedModel,
|
|
54
54
|
environment: options.environment ?? options.client.environment,
|
|
@@ -69,7 +69,7 @@ export function instrumentGoogle(googleModel, options) {
|
|
|
69
69
|
return response;
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
72
|
-
|
|
72
|
+
await options.client.captureEventAndFlush(buildEvent({
|
|
73
73
|
provider: "google",
|
|
74
74
|
model: requestedModel,
|
|
75
75
|
environment: options.environment ?? options.client.environment,
|
|
@@ -49,7 +49,7 @@ export function instrumentOpenAI(openaiClient, options) {
|
|
|
49
49
|
markClampAppliedIfChanged(protectDecision, extractMaxOutputTokens(args), extractMaxOutputTokens(callArgs));
|
|
50
50
|
try {
|
|
51
51
|
const response = await originalCreate(...callArgs);
|
|
52
|
-
|
|
52
|
+
await options.client.captureEventAndFlush(buildEvent({
|
|
53
53
|
provider: "openai",
|
|
54
54
|
model: extractResponseModel(response) ?? model,
|
|
55
55
|
environment: options.environment ?? options.client.environment,
|
|
@@ -69,7 +69,7 @@ export function instrumentOpenAI(openaiClient, options) {
|
|
|
69
69
|
return response;
|
|
70
70
|
}
|
|
71
71
|
catch (error) {
|
|
72
|
-
|
|
72
|
+
await options.client.captureEventAndFlush(buildEvent({
|
|
73
73
|
provider: "openai",
|
|
74
74
|
model,
|
|
75
75
|
environment: options.environment ?? options.client.environment,
|
package/package.json
CHANGED