-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d650052
commit 9742688
Showing
28 changed files
with
5,652 additions
and
4,000 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Typescript CI | ||
|
||
on: | ||
push: | ||
branches: [main] | ||
pull_request: | ||
paths: | ||
- "js/**" | ||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: test-typescript-${{ github.head_ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
ci: | ||
name: CI Typescript | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout Repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Nodejs | ||
uses: actions/setup-node@v3 | ||
with: | ||
node-version: 16 | ||
- name: Setup PNPM | ||
uses: pnpm/action-setup@v2 | ||
with: | ||
version: 8 | ||
- name: Install Dependencies | ||
working-directory: ./js | ||
run: pnpm install --frozen-lockfile | ||
- name: Formatting | ||
working-directory: ./js | ||
run: | | ||
pnpm run prettier:check |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pnpm-lock.yaml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
{ | ||
"name": "openai-example", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "\"Example OpenAI integration with OpenInference\"", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "tsc --build tsconfig.json", | ||
"start": "node dist/index.js" | ||
}, | ||
"author": "mikyo@arize.com", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@arizeai/openinference-instrumentation-openai": "^0.0.2", | ||
"@opentelemetry/exporter-trace-otlp-http": "^0.46.0", | ||
"@opentelemetry/exporter-trace-otlp-proto": "^0.46.0", | ||
"@opentelemetry/resources": "^1.19.0", | ||
"@opentelemetry/sdk-trace-node": "^1.19.0", | ||
"openai": "^4.24.1" | ||
} | ||
"name": "openai-example", | ||
"version": "0.0.0", | ||
"private": true, | ||
"description": "\"Example OpenAI integration with OpenInference\"", | ||
"main": "index.js", | ||
"scripts": { | ||
"build": "tsc --build tsconfig.json", | ||
"start": "node dist/index.js" | ||
}, | ||
"author": "mikyo@arize.com", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@arizeai/openinference-instrumentation-openai": "^0.0.2", | ||
"@opentelemetry/exporter-trace-otlp-http": "^0.46.0", | ||
"@opentelemetry/exporter-trace-otlp-proto": "^0.46.0", | ||
"@opentelemetry/resources": "^1.19.0", | ||
"@opentelemetry/sdk-trace-node": "^1.19.0", | ||
"openai": "^4.24.1" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,31 @@ | ||
import { registerInstrumentations } from "@opentelemetry/instrumentation"; | ||
import { OpenAIInstrumentation } from "@arizeai/openinference-instrumentation-openai"; | ||
import { | ||
ConsoleSpanExporter, | ||
SimpleSpanProcessor, | ||
BatchSpanProcessor, | ||
ConsoleSpanExporter, | ||
SimpleSpanProcessor, | ||
BatchSpanProcessor, | ||
} from "@opentelemetry/sdk-trace-base"; | ||
import { NodeTracerProvider } from "@opentelemetry/sdk-trace-node"; | ||
import { Resource } from "@opentelemetry/resources"; | ||
import { OTLPTraceExporter } from "@opentelemetry/exporter-trace-otlp-proto"; | ||
import { SemanticResourceAttributes } from "@opentelemetry/semantic-conventions"; | ||
|
||
const provider = new NodeTracerProvider({ | ||
resource: new Resource({ | ||
[SemanticResourceAttributes.SERVICE_NAME]: "openai-service", | ||
}), | ||
resource: new Resource({ | ||
[SemanticResourceAttributes.SERVICE_NAME]: "openai-service", | ||
}), | ||
}); | ||
|
||
provider.addSpanProcessor(new SimpleSpanProcessor(new ConsoleSpanExporter())); | ||
provider.addSpanProcessor( | ||
new SimpleSpanProcessor( | ||
new OTLPTraceExporter({ | ||
url: "http://localhost:6006/v1/traces", | ||
}) | ||
) | ||
new SimpleSpanProcessor( | ||
new OTLPTraceExporter({ | ||
url: "http://localhost:6006/v1/traces", | ||
}), | ||
), | ||
); | ||
provider.register(); | ||
|
||
registerInstrumentations({ | ||
instrumentations: [new OpenAIInstrumentation({})], | ||
instrumentations: [new OpenAIInstrumentation({})], | ||
}); |
Oops, something went wrong.