Skip to content

Commit

Permalink
fix: use correct versions from package.json (#154)
Browse files Browse the repository at this point in the history
  • Loading branch information
nirga authored Mar 15, 2024
1 parent 7304563 commit a095fbc
Show file tree
Hide file tree
Showing 14 changed files with 46 additions and 12 deletions.
21 changes: 21 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion packages/instrumentation-azure/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,13 @@ import type {
ChatRequestMessage,
Completions,
} from "@azure/openai";
import { version } from "../package.json";

export class AzureOpenAIInstrumentation extends InstrumentationBase<any> {
protected override _config!: AzureOpenAIInstrumentationConfig;

constructor(config: AzureOpenAIInstrumentationConfig = {}) {
super("@traceloop/instrumentation-azure", "0.3.0", config);
super("@traceloop/instrumentation-azure", version, config);
}

public override setConfig(config: AzureOpenAIInstrumentationConfig = {}) {
Expand Down
3 changes: 2 additions & 1 deletion packages/instrumentation-bedrock/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import {
LLMRequestTypeValues,
SpanAttributes,
} from "@traceloop/ai-semantic-conventions";
import { version } from "../package.json";

export class BedrockInstrumentation extends InstrumentationBase<any> {
protected override _config!: BedrockInstrumentationConfig;

constructor(config: BedrockInstrumentationConfig = {}) {
super("@traceloop/instrumentation-bedrock", "0.3.0", config);
super("@traceloop/instrumentation-bedrock", version, config);
}

public override setConfig(config: BedrockInstrumentationConfig = {}) {
Expand Down
3 changes: 2 additions & 1 deletion packages/instrumentation-cohere/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,14 @@ import {
LLMRequestTypeValues,
SpanAttributes,
} from "@traceloop/ai-semantic-conventions";
import { version } from "../package.json";

type LLM_COMPLETION_TYPE = "chat" | "completion" | "rerank";
export class CohereInstrumentation extends InstrumentationBase<any> {
protected override _config!: CohereInstrumentationConfig;

constructor(config: CohereInstrumentationConfig = {}) {
super("@traceloop/instrumentation-cohere", "0.3.11", config);
super("@traceloop/instrumentation-cohere", version, config);
}

public override setConfig(config: CohereInstrumentationConfig = {}) {
Expand Down
3 changes: 2 additions & 1 deletion packages/instrumentation-langchain/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@ import { taskWrapper, workflowWrapper } from "./utils";
import type * as ChainsModule from "langchain/chains";
import type * as AgentsModule from "langchain/agents";
import type * as ToolsModule from "langchain/tools";
import { version } from "../package.json";

export class LangChainInstrumentation extends InstrumentationBase<any> {
protected override _config!: LangChainInstrumentationConfig;

constructor(config: LangChainInstrumentationConfig = {}) {
super("@traceloop/instrumentation-langchain", "0.3.0", config);
super("@traceloop/instrumentation-langchain", version, config);
}

public manuallyInstrument({
Expand Down
3 changes: 2 additions & 1 deletion packages/instrumentation-llamaindex/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ import type {
BaseRetriever,
} from "llamaindex";
import { TraceloopSpanKindValues } from "@traceloop/ai-semantic-conventions";
import { version } from "../package.json";

export class LlamaIndexInstrumentation extends InstrumentationBase<any> {
protected override _config!: LlamaIndexInstrumentationConfig;

constructor(config: LlamaIndexInstrumentationConfig = {}) {
super("@traceloop/instrumentation-llamaindex", "0.3.0", config);
super("@traceloop/instrumentation-llamaindex", version, config);
}

public override setConfig(config: LlamaIndexInstrumentationConfig = {}) {
Expand Down
3 changes: 2 additions & 1 deletion packages/instrumentation-openai/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,13 @@ import type {
CompletionCreateParamsStreaming,
} from "openai/resources";
import type { Stream } from "openai/streaming";
import { version } from "../package.json";

export class OpenAIInstrumentation extends InstrumentationBase<any> {
protected override _config!: OpenAIInstrumentationConfig;

constructor(config: OpenAIInstrumentationConfig = {}) {
super("@traceloop/instrumentation-openai", "0.3.0", config);
super("@traceloop/instrumentation-openai", version, config);
}

public override setConfig(config: OpenAIInstrumentationConfig = {}) {
Expand Down
3 changes: 2 additions & 1 deletion packages/instrumentation-pinecone/src/instrumentation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,11 @@ import {
SpanAttributes,
EventAttributes,
} from "@traceloop/ai-semantic-conventions";
import { version } from "../package.json";

export class PineconeInstrumentation extends InstrumentationBase<any> {
constructor(config: InstrumentationConfig = {}) {
super("@traceloop/instrumentation-pinecone", "0.3.0", config);
super("@traceloop/instrumentation-pinecone", version, config);
}

public manuallyInstrument(module: typeof pinecone) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,13 @@ import {
} from "@traceloop/ai-semantic-conventions";
import type * as aiplatform from "@google-cloud/aiplatform";
import type { CallOptions, Callback } from "google-gax";
import { version } from "../package.json";

export class AIPlatformInstrumentation extends InstrumentationBase<any> {
protected override _config!: AIPlatformInstrumentationConfig;

constructor(config: AIPlatformInstrumentationConfig = {}) {
super("@traceloop/instrumentation-vertexai", "0.3.0", config);
super("@traceloop/instrumentation-vertexai", version, config);
}

public override setConfig(config: AIPlatformInstrumentationConfig = {}) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ import {
SpanAttributes,
} from "@traceloop/ai-semantic-conventions";
import type * as vertexAI from "@google-cloud/vertexai";
import { version } from "../package.json";

export class VertexAIInstrumentation extends InstrumentationBase<any> {
protected override _config!: VertexAIInstrumentationConfig;

constructor(config: VertexAIInstrumentationConfig = {}) {
super("@traceloop/instrumentation-vertexai", "0.3.0", config);
super("@traceloop/instrumentation-vertexai", version, config);
}

public override setConfig(config: VertexAIInstrumentationConfig = {}) {
Expand Down
1 change: 1 addition & 0 deletions packages/traceloop-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
"@pollyjs/adapter-node-http": "^6.0.6",
"@pollyjs/core": "^6.0.6",
"@pollyjs/persister-fs": "^6.0.6",
"@rollup/plugin-json": "^6.1.0",
"@rollup/plugin-typescript": "^11.1.6",
"@types/mocha": "^10.0.6",
"@types/node": "^20.9.0",
Expand Down
3 changes: 2 additions & 1 deletion packages/traceloop-sdk/rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
const dts = require("rollup-plugin-dts");
const typescript = require("@rollup/plugin-typescript");
const json = require("@rollup/plugin-json");

// eslint-disable-next-line @typescript-eslint/no-var-requires
const name = require("./package.json").main.replace(/\.js$/, "");
Expand All @@ -12,7 +13,7 @@ const bundle = (config) => ({

exports.default = [
bundle({
plugins: [typescript.default()],
plugins: [typescript.default(), json.default()],
output: [
{
file: `${name}.js`,
Expand Down
3 changes: 2 additions & 1 deletion packages/traceloop-sdk/src/lib/telemetry/telemetry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import * as fs from "fs";
import * as path from "path";
import { v4 as uuid } from "uuid";
import { PostHog } from "posthog-node";
import { version } from "../../../package.json";

export class Telemetry {
private static instance: Telemetry;
Expand Down Expand Up @@ -59,7 +60,7 @@ export class Telemetry {
private getContext() {
return {
sdk: "typescript",
sdk_version: "0.0.23",
sdk_version: version,
};
}

Expand Down
3 changes: 2 additions & 1 deletion packages/traceloop-sdk/src/lib/tracing/score.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { _configuration } from "../configuration";
import { diag } from "@opentelemetry/api";
import { version } from "../../../package.json";

export async function reportScore(
associationProperty: { [name: string]: string },
Expand Down Expand Up @@ -27,7 +28,7 @@ export async function reportScore(
headers: {
"Content-Type": "application/json",
Authorization: `Bearer ${_configuration.apiKey}`,
"X-Traceloop-SDK-Version": "0.0.30",
"X-Traceloop-SDK-Version": version,
},
body: JSON.stringify({
score,
Expand Down

0 comments on commit a095fbc

Please sign in to comment.