Skip to content

feat: Add instrumentation for @huggingface/inference#1807

Merged
Luca Forstner (lforst) merged 4 commits intomainfrom
lforst/instrument-hf-sdk
Apr 13, 2026
Merged

feat: Add instrumentation for @huggingface/inference#1807
Luca Forstner (lforst) merged 4 commits intomainfrom
lforst/instrument-hf-sdk

Conversation

@lforst
Copy link
Copy Markdown
Member

Resolves: #1806

Comment on lines +324 to +325
...(extractResponseMetadata(lastChunk)
? { metadata: extractResponseMetadata(lastChunk) }
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Called twice, we can extract.

Comment on lines +363 to +365
...(extractTextGenerationStreamMetadata(chunks)
? {
metadata: extractTextGenerationStreamMetadata(chunks),
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also called twice.


function hasFunction(value: unknown, methodName: string): boolean {
return (
isRecord(value) &&
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we have isObject we can use. We should prob point the agent at trying to use common utils.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

very fair

# Conflicts:
#	.env.example
#	e2e/README.md
#	e2e/helpers/scenario-installer.ts
@lforst Luca Forstner (lforst) merged commit c16f6ba into main Apr 13, 2026
47 of 49 checks passed
@lforst Luca Forstner (lforst) deleted the lforst/instrument-hf-sdk branch April 13, 2026 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants