百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
U

unity-api

> 编程语言
开源

Hugging Face 适用于 Unity 的 API 此 Unity 包提供了一个易于使用的集成,用于 Hugging Face 推理 API,允许开发人员在 Unity 中使用该 API。

360 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

Hugging Face 适用于 Unity 的 API 此 Unity 包提供了一个易于使用的集成,用于 Hugging Face 推理 API,允许开发人员在 Unity 中使用该 API。

Hugging Face API for Unity

This Unity package provides an easy-to-use integration for the Hugging Face Inference API, allowing developers to access and use Hugging Face AI models within their Unity projects.

Table of Contents

  1. Installation
  2. Usage
    • Configuration
    • Example Scene
    • API Usage in Scripts
  3. Tasks
  4. Support

Installation

Via Git URL

  1. Open the Unity project you want to add the package to.
  2. Go to "Window" > "Package Manager" to open the Package Manager.
  3. Click the "+" in the upper left hand corner and select "Add package from git URL".
  4. Enter the URL of this repository and click "Add": https://github.com/huggingface/unity-api.git

Usage

Configuration

In the Hugging Face Website:

  1. Generate an API key in https://huggingface.co/settings/tokens, we **advise you to create a Fine-Grained Token.

  2. When the API key is created click on Set Permissions

  3. Authorize Inference with this API key

After installation, the Hugging Face API wizard should open. If not, open it by clicking "Window" > "Hugging Face API Wizard".

  1. Test the API key.

  2. Optionally, update the endpoints to use different models.

Try our tutorial

To help you getting started, we wrote a tutorial where you create a robot agent that understands text orders and executes them.

The tutorial https://thomassimonini.substack.com/p/building-a-smart-robot-ai-using-hugging

The demo https://huggingface.co/spaces/ThomasSimonini/SmartRobot

Example Scene

To try the included example scene, follow these steps:

  1. Click "Install Examples" in the Hugging Face API Wizard to copy the example files into your project.
  2. Navigate to the "Hugging Face API" > "Examples" > "Scenes" folder in your project.
  3. Open the "ConversationExample" scene.
  4. If prompted by the TMP Importer, click "Import TMP Essentials".
  5. Press "Play" to run the example. You should be able to use the UI to interact with the model.

API Usage in Scripts

The package includes a HuggingFaceAPI class that you can use from your scripts.

  1. Import the HuggingFace.API namespace in your script.
  2. Call the API method for the task you want.
using HuggingFace.API;

HuggingFaceAPI.TextToImage("a cat in a hat", result => {
    // Do something with the result, which in this case is a Texture2D
}, error => {
    // Handle errors
    Debug.LogError(error);
});

For a more advanced scripting example, refer to the included example scripts.

Tasks

Task Status
Conversation ✅
Text Generation ✅
Text to Image ✅
Text Classification ✅
Zero Shot Text Classification ✅
Question Answering ✅
Translation ✅
Summarization ✅
Sentence Similarity ✅
Speech Recognition ✅

Support

If you encounter issues or have questions about the package, open an issue on the repository.

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

C#

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类编程语言
定价开源

> 相关工具

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言