Ahmud commited on
Commit
468fa7b
·
verified ·
1 Parent(s): 66f6cc6

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +17 -67
README.md CHANGED
@@ -1,67 +1,17 @@
1
- # Hugging Face AI Agents Course - Final Exam Agent
2
-
3
- This project contains an AI agent developed for the final exam of the Hugging Face AI Agents Course. The agent is designed to answer a variety of questions by leveraging a suite of powerful tools and a language model.
4
-
5
- ## Overview
6
-
7
- This agent is built using the `LangGraph` library to create a robust and stateful agent. It can perform a variety of tasks, including web searches, calculations, code execution, and processing different types of media like audio, images, and documents. The project includes a Gradio application for evaluating the agent's performance on a set of questions provided by the course.
8
-
9
- ## Features
10
-
11
- * **Multi-tool Integration**: The agent can use a wide range of tools to solve complex problems.
12
- * **Conversational AI**: Powered by a capable language model from OpenRouter.
13
- * **Stateful Execution**: Uses `LangGraph` to manage the conversation flow and tool execution in a structured manner.
14
- * **Web Interface**: A Gradio app (`app.py`) is provided to test and evaluate the agent.
15
- * **Extensible**: New tools can be easily added to enhance the agent's capabilities.
16
-
17
- ## Tools
18
-
19
- The agent has access to the following tools:
20
-
21
- ### Community Tools
22
-
23
- * **Brave Search**: Performs web searches to find up-to-date information.
24
- * **Python REPL**: Executes Python code to solve logic and math problems.
25
-
26
- ### Custom Tools
27
-
28
- * **Calculator**:
29
- * `add(a, b)`: Adds two numbers.
30
- * `subtract(a, b)`: Subtracts two numbers.
31
- * `multiply(a, b)`: Multiplies two numbers.
32
- * `divide(a, b)`: Divides two numbers.
33
- * `power(a, b)`: Calculates `a` to the power of `b`.
34
- * **Date & Time**:
35
- * `current_date()`: Returns the current date.
36
- * `day_of_week()`: Returns the current day of the week.
37
- * `days_until(date_str)`: Calculates the number of days until a given date.
38
- * **Media Processing**:
39
- * `transcribe_audio(audio_file, file_extension)`: Transcribes audio files.
40
- * `transcribe_youtube(youtube_url)`: Transcribes YouTube videos.
41
- * `query_image(query, image_url)`: Answers questions about an image.
42
- * **Web & Document Content**:
43
- * `webpage_content(url)`: Extracts text from webpages and PDF files.
44
- * `read_excel(file_path, sheet_name, query)`: Reads data from an Excel file and answers a query about it.
45
-
46
- ## How It Works
47
-
48
- The agent's logic is defined in `agent.py`. It uses a `StateGraph` from the `LangGraph` library to manage its execution flow. The graph has two main nodes:
49
-
50
- 1. **`llm_call`**: This node calls the language model with the current conversation history and a system prompt (`prompt.py`). The LLM decides whether to respond directly to the user or to use one of the available tools.
51
- 2. **`environment`**: If the LLM decides to use a tool, this node executes the tool with the arguments provided by the LLM.
52
-
53
- The agent alternates between these two nodes until the LLM generates a final answer for the user.
54
-
55
- ## Usage
56
-
57
- ### 1. Installation
58
-
59
- Clone the repository and install the required dependencies:
60
-
61
- ```bash
62
- git clone https://huggingface.co/spaces/YOUR_SPACE_HERE
63
- cd YOUR_REPO
64
- pip install -r requirements.txt
65
- ```
66
-
67
- Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
 
1
+ ---
2
+ title: Template Final Assignment
3
+ emoji: 🕵🏻‍♂️
4
+ sdk: gradio
5
+ colorFrom: indigo
6
+ colorTo: indigo
7
+ ---
8
+ title: Template Final Assignment
9
+ emoji: 🕵🏻‍♂️
10
+ colorFrom: indigo
11
+ colorTo: indigo
12
+ sdk: gradio
13
+ sdk_version: 5.25.2
14
+ app_file: app.py
15
+ pinned: false
16
+ hf_oauth: true
17
+ hf_oauth_expiration_minutes: 480