Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion packages/traceloop-sdk/src/lib/tracing/manual.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ export class LLMSpan {
}[];
}) {
this.span.setAttributes({
[SpanAttributes.LLM_REQUEST_MODEL]: model,
[SpanAttributes.LLM_REQUEST_MODEL]: model
});

messages.forEach((message, index) => {
Expand Down Expand Up @@ -163,6 +163,7 @@ export function withLLMCall<
F extends ({ span }: { span: LLMSpan }) => ReturnType<F>,
>({ vendor, type }: LLMCallConfig, fn: F, thisArg?: ThisParameterType<F>) {
const span = getTracer().startSpan(`${vendor}.${type}`, {}, context.active());
span.setAttribute(SpanAttributes.LLM_REQUEST_TYPE, type);
trace.setSpan(context.active(), span);

const res = fn.apply(thisArg, [{ span: new LLMSpan(span) }]);
Expand Down