Skip to content

Xircuits component library for hugging face agents.

License

Notifications You must be signed in to change notification settings

XpressAI/xai-hfagent

Repository files navigation

Component LibrariesProject Templates
DocsInstallTutorialsDeveloper GuidesContributeBlogDiscord

Xircuits Component Library for Hugging Face – Build advanced workflows with powerful AI tools.


Xircuits Component Library for Hugging Face Agent Toolkit

This library integrates Hugging Face capabilities into Xircuits workflows, enabling the use of language models, custom tool creation, and text/image processing.

Table of Contents

Preview

SimpleHfAgent Example

HF_sample_example

Result

HF_sample

Prerequisites

Before you begin, you will need:

  1. Python 3.9+.
  2. Xircuits installed.
  3. Hugging Face API token

Main Xircuits Components

HfAgentInit Component:

Initializes a Hugging Face language model agent with support for tools and token configuration.

HfAgentInit

HfAgentMakeTool Component:

Creates custom tools for Hugging Face agents with a name, description, and functionality.

HfAgentMakeTool

HfAgentRun Component:

Executes prompts using the initialized agent and retrieves generated responses.

HfReadImage Component:

Loads an image file and prepares it for AI processing.

Try The Examples

We have provided an example workflow to help you get started with the Hugging Face Agent component library. Give it a try and see how you can create custom Hugging Face Agent components for your applications.

HF_sample Example

Check out the HF_sample.xircuits workflow. This example initializes a Hugging Face agent and uses the HfAgentRun component to process a prompt and generate a response. A custom tool is created and integrated with the agent to answer simple questions like "What is the capital of France?"

Installation

To use this component library, ensure that you have an existing Xircuits setup. You can then install the Hugging Face Agent library using the component library interface, or through the CLI using:

xircuits install hfagent

You can also do it manually by cloning and installing it:

# base Xircuits directory
git clone https://github.com/XpressAI/xai-hfagent xai_components/xai_hfagent
pip install -r xai_components/xai_hfagent/requirements.txt 

About

Xircuits component library for hugging face agents.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages