@arizeai/phoenix-client
Version:
A client for the Phoenix API
10 lines (8 loc) • 303 B
text/typescript
import { AttributeValue } from "@opentelemetry/api";
export function objectAsAttributes<T extends Record<string, unknown>>(
obj: T
): Record<string, AttributeValue> {
return Object.fromEntries(
Object.entries(obj).filter(([_, value]) => value !== null)
) as Record<string, AttributeValue>;
}