Skip to content

Commit

Permalink
Merge branch 'development' into release
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikscale3 committed Nov 12, 2024
2 parents b313278 + 18eb9f5 commit e497f08
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 13 deletions.
20 changes: 7 additions & 13 deletions app/(protected)/project/[project_id]/annotations/annotations.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -68,28 +68,22 @@ export default function Annotations({ email }: { email: string }) {
const filters = {
filters: [
{
operation: "OR",
operation: "AND",
filters: [
{
key: "llm.prompts",
operation: "NOT_EQUALS",
value: "",
type: "attribute",
},
{
key: "name",
operation: "EQUALS",
value: "gen_ai.content.completion",
type: "event",
},
{
key: "status_code",
operation: "EQUALS",
value: "STATUS_CODE_OK",
type: "property",
},
],
},
{
key: "status_code",
operation: "EQUALS",
value: "OK",
type: "property",
},
],
operation: "AND",
};
Expand Down
20 changes: 20 additions & 0 deletions components/shared/vendor-metadata.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,10 @@ export function vendorColor(vendor: string) {
return "bg-black";
}

if (vendor.includes("mongodb")) {
return "bg-green-200";
}

return "bg-gray-800";
}

Expand Down Expand Up @@ -487,6 +491,22 @@ export function VendorLogo({
);
}

if (vendor.includes("mongodb")) {
const color = vendorColor("mongodb");
return (
<Image
alt="MongoDB Logo"
src="/mongodb.png"
width={50}
height={50}
className={cn(
`${color} p-[3px]`,
variant === "circular" ? "rounded-full" : "rounded-md"
)}
/>
);
}

return (
<div className="flex items-center p-1 rounded-sm">
<StackIcon
Expand Down
2 changes: 2 additions & 0 deletions components/traces/trace_graph.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ const SpanItem: React.FC<SpanItemProps> = ({
color = "bg-slate-500";
else if (span.name.includes("litellm") || serviceName.includes("litellm"))
color = "bg-blue-500";
else if (span.name.includes("mongodb") || serviceName.includes("mongodb"))
color = "bg-green-500";
const fillColor = color.replace("bg-", "fill-");

const vendor = getVendorFromSpan(span as any);
Expand Down
6 changes: 6 additions & 0 deletions lib/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -576,6 +576,10 @@ export function calculatePriceFromUsage(
costTable = ANTHROPIC_PRICING[cmodel];
} else if (model.includes("command")) {
costTable = COHERE_PRICING[model];
} else if (model.includes("gemini")) {
costTable = GEMINI_PRICING[model];
} else if (model.includes("grok")) {
costTable = XAI_PRICING[model];
}
} else if (vendor === "openai") {
// check if model is present as key in OPENAI_PRICING
Expand Down Expand Up @@ -827,6 +831,8 @@ export function getVendorFromSpan(span: Span): string {
vendor = "embedchain";
} else if (span.name.includes("litellm") || serviceName.includes("litellm")) {
vendor = "litellm";
} else if (span.name.includes("mongodb") || serviceName.includes("mongodb")) {
vendor = "mongodb";
}
return vendor;
}
Expand Down
Binary file added public/mongodb.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e497f08

Please sign in to comment.