Skip to content

[WIP] Add user agent with package version for hub calls #1490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

Copilot
Copy link
Contributor

@Copilot Copilot AI commented May 23, 2025

  • Create a utility function to wrap fetch and add user-agent header
  • Add package version constant in consts.ts
  • Implement the createFetch function in a new utils file
  • Add tests to verify the user agent is being set correctly
  • Update documentation if necessary
  • Final testing and verification

Fixes #899.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@julien-c
Copy link
Member

please try again

Copy link
Contributor Author

Copilot AI commented May 26, 2025

please try again

I've implemented the user agent with package version for hub calls. The solution adds a VERSION and USER_AGENT constant to consts.ts, creates a createFetch utility function that wraps fetch and adds the user-agent header, and exports both the utility function and a pre-configured fetchWithUserAgent instance. I've also added comprehensive tests to verify the functionality works correctly. (0a276b7)

Warning

Firewall rules blocked me from connecting to one or more addresses

I tried to connect to the following addresses, but was blocked by firewall rules:

  • hub-ci.huggingface.co
    • Triggering command: node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run (dns block)
  • huggingface.co
    • Triggering command: node /home/REDACTED/work/huggingface.js/huggingface.js/node_modules/.bin/../vitest/vitest.mjs run (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot finished work on behalf of julien-c May 26, 2025 09:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add user agent with package version for hub calls
2 participants