Spaces:
Sleeping
Sleeping
Commit
·
a3859a8
1
Parent(s):
60f0600
Fix what_can_i_do tool: convert to proper Tool class
Browse files- what_can_i_do.py +60 -0
what_can_i_do.py
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import opik
|
| 2 |
+
from smolagents import Tool
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class WhatCanIDoTool(Tool):
|
| 6 |
+
name = "what_can_i_do"
|
| 7 |
+
description = """Returns a comprehensive list of available capabilities and topics in the Second Brain system.
|
| 8 |
+
|
| 9 |
+
This tool should be used when:
|
| 10 |
+
- The user explicitly asks what the system can do
|
| 11 |
+
- The user asks about available features or capabilities
|
| 12 |
+
- The user seems unsure about what questions they can ask
|
| 13 |
+
- The user wants to explore the system's knowledge areas
|
| 14 |
+
|
| 15 |
+
This tool should NOT be used when:
|
| 16 |
+
- The user asks a specific technical question
|
| 17 |
+
- The user already knows what they want to learn about
|
| 18 |
+
- The question is about a specific topic covered in the knowledge base"""
|
| 19 |
+
|
| 20 |
+
inputs = {
|
| 21 |
+
"question": {
|
| 22 |
+
"type": "string",
|
| 23 |
+
"description": "The user's query about system capabilities. While this parameter is required, the function returns a standard capability list regardless of the specific question."
|
| 24 |
+
}
|
| 25 |
+
}
|
| 26 |
+
output_type = "string"
|
| 27 |
+
|
| 28 |
+
@opik.track(name="what_can_i_do")
|
| 29 |
+
def forward(self, question: str) -> str:
|
| 30 |
+
"""Returns a comprehensive list of available capabilities and topics in the Second Brain system."""
|
| 31 |
+
return """
|
| 32 |
+
You can ask questions about the content in your Second Brain, such as:
|
| 33 |
+
|
| 34 |
+
Architecture and Systems:
|
| 35 |
+
- What is the feature/training/inference (FTI) architecture?
|
| 36 |
+
- How do agentic systems work?
|
| 37 |
+
- Detail how does agent memory work in agentic applications?
|
| 38 |
+
|
| 39 |
+
LLM Technology:
|
| 40 |
+
- What are LLMs?
|
| 41 |
+
- What is BERT (Bidirectional Encoder Representations from Transformers)?
|
| 42 |
+
- Detail how does RLHF (Reinforcement Learning from Human Feedback) work?
|
| 43 |
+
- What are the top LLM frameworks for building applications?
|
| 44 |
+
- Write me a paragraph on how can I optimize LLMs during inference?
|
| 45 |
+
|
| 46 |
+
RAG and Document Processing:
|
| 47 |
+
- What tools are available for processing PDFs for LLMs and RAG?
|
| 48 |
+
- What's the difference between vector databases and vector indices?
|
| 49 |
+
- How does document chunk overlap affect RAG performance?
|
| 50 |
+
- What is chunk reranking and why is it important?
|
| 51 |
+
- What are advanced RAG techniques for optimization?
|
| 52 |
+
- How can RAG pipelines be evaluated?
|
| 53 |
+
|
| 54 |
+
Learning Resources:
|
| 55 |
+
- Can you recommend courses on LLMs and RAG?
|
| 56 |
+
"""
|
| 57 |
+
|
| 58 |
+
|
| 59 |
+
# Create an instance for backward compatibility
|
| 60 |
+
what_can_i_do = WhatCanIDoTool()
|