@traceloop/instrumentation-bedrock 0.23.0 → 0.24.0
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 +12 -1
- package/dist/index.js +322 -98
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +324 -101
- package/dist/src/instrumentation.d.ts +4 -0
- package/dist/src/types.d.ts +7 -0
- package/package.json +8 -6
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { InstrumentationConfig, InstrumentationBase, InstrumentationModuleDefinition } from '@opentelemetry/instrumentation';
|
|
2
2
|
import * as bedrock from '@aws-sdk/client-bedrock-runtime';
|
|
3
3
|
|
|
4
|
+
declare enum BedrockVendor {
|
|
5
|
+
AI21 = "ai21",
|
|
6
|
+
AMAZON = "amazon",
|
|
7
|
+
ANTHROPIC = "anthropic",
|
|
8
|
+
COHERE = "cohere",
|
|
9
|
+
META = "meta"
|
|
10
|
+
}
|
|
4
11
|
interface BedrockInstrumentationConfig extends InstrumentationConfig {
|
|
5
12
|
/**
|
|
6
13
|
* Whether to log prompts, completions and embeddings on traces.
|
|
@@ -13,6 +20,7 @@ interface BedrockInstrumentationConfig extends InstrumentationConfig {
|
|
|
13
20
|
exceptionLogger?: (e: Error) => void;
|
|
14
21
|
}
|
|
15
22
|
|
|
23
|
+
declare const bedrockFinishReasonMap: Record<string, string>;
|
|
16
24
|
declare class BedrockInstrumentation extends InstrumentationBase {
|
|
17
25
|
protected _config: BedrockInstrumentationConfig;
|
|
18
26
|
constructor(config?: BedrockInstrumentationConfig);
|
|
@@ -27,9 +35,12 @@ declare class BedrockInstrumentation extends InstrumentationBase {
|
|
|
27
35
|
private _endSpan;
|
|
28
36
|
private _setRequestAttributes;
|
|
29
37
|
private _setResponseAttributes;
|
|
38
|
+
private _handleNovaStreamingMetadata;
|
|
30
39
|
private _shouldSendPrompts;
|
|
40
|
+
private _getOperationType;
|
|
41
|
+
private _getStreamChunkContent;
|
|
31
42
|
private _extractVendorAndModel;
|
|
32
43
|
}
|
|
33
44
|
|
|
34
|
-
export { BedrockInstrumentation };
|
|
45
|
+
export { BedrockInstrumentation, BedrockVendor, bedrockFinishReasonMap };
|
|
35
46
|
export type { BedrockInstrumentationConfig };
|