Spaces:
Sleeping
Sleeping
Update README.md
Browse files
README.md
CHANGED
@@ -1,67 +1,17 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|