Skip to content

Commit

Permalink
Merge branch 'main' into renovate/autoblocksai-0.x-lockfile
Browse files Browse the repository at this point in the history
  • Loading branch information
Nicole White authored Feb 26, 2024
2 parents f1b6773 + 7c66d51 commit e0521b2
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
3 changes: 2 additions & 1 deletion JavaScript/chatbot-nextjs/src/pages/api/chat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ export default async function handler(

// Substitute this for process.env.AUTOBLOCKS_INGESTION_KEY in a production environment
// You can also initialize this outside of the handler in that case
const tracer = new AutoblocksTracer(autoblocksIngestionKey, {
const tracer = new AutoblocksTracer({
ingestionKey: autoblocksIngestionKey,
traceId,
properties: {
provider: 'openai',
Expand Down
3 changes: 2 additions & 1 deletion JavaScript/chatbot-nextjs/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,8 @@ export default function Chat() {
};

const onFeedback = async (feedback: 'positive' | 'negative') => {
const tracer = new AutoblocksTracer(autoblocksIngestionKey, {
const tracer = new AutoblocksTracer({
ingestionKey: autoblocksIngestionKey,
traceId,
});
await tracer.sendEvent('user.feedback', {
Expand Down
2 changes: 1 addition & 1 deletion JavaScript/openai-tracing/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const openai = new OpenAI({
apiKey: process.env.OPENAI_API_KEY,
});

const tracer = new AutoblocksTracer(process.env.AUTOBLOCKS_INGESTION_KEY, {
const tracer = new AutoblocksTracer({
// These apply to every call of tracer.sendEvent() so we don't have to repeat them
traceId: crypto.randomUUID(),
properties: {
Expand Down
2 changes: 1 addition & 1 deletion JavaScript/spans/src/index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import crypto from 'crypto';
import { AutoblocksTracer } from '@autoblocks/client';

const tracer = new AutoblocksTracer(process.env.AUTOBLOCKS_INGESTION_KEY, {
const tracer = new AutoblocksTracer({
traceId: crypto.randomUUID(),
properties: {
provider: 'openai',
Expand Down

0 comments on commit e0521b2

Please sign in to comment.