Dylan commited on
Commit
e91fd56
Β·
0 Parent(s):
Files changed (6) hide show
  1. .gitignore +75 -0
  2. README.md +79 -0
  3. app.py +285 -0
  4. data/monologues/monologues.txt +27 -0
  5. pyproject.toml +25 -0
  6. requirements.txt +9 -0
.gitignore ADDED
@@ -0,0 +1,75 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Poetry
24
+ poetry.lock
25
+ .venv/
26
+ venv/
27
+
28
+ # Virtual Environment
29
+ .env
30
+ .venv
31
+ env/
32
+ ENV/
33
+
34
+ # IDE
35
+ .idea/
36
+ .vscode/
37
+ *.swp
38
+ *.swo
39
+ .DS_Store
40
+
41
+ # Jupyter Notebook
42
+ .ipynb_checkpoints
43
+ *.ipynb
44
+
45
+ # ML/AI specific
46
+ *.pt
47
+ *.pth
48
+ *.onnx
49
+ *.h5
50
+ models/
51
+ checkpoints/
52
+ runs/
53
+ wandb/
54
+ logs/
55
+ .cache/
56
+
57
+ # Testing
58
+ .coverage
59
+ htmlcov/
60
+ .pytest_cache/
61
+ .tox/
62
+
63
+ # Distribution
64
+ .Python
65
+ dist/
66
+ build/
67
+ *.manifest
68
+ *.spec
69
+
70
+ # Misc
71
+ .DS_Store
72
+ .env.local
73
+ .env.development.local
74
+ .env.test.local
75
+ .env.production.local
README.md ADDED
@@ -0,0 +1,79 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Fun Philosophy Agent
2
+
3
+ A delightful AI agent that engages in philosophical discussions through the voice of a unique character. Built with Gradio and hosted on Hugging Face Spaces.
4
+
5
+ ## Description
6
+
7
+ This project creates an interactive AI agent that discusses philosophy in an engaging and character-driven way. It combines modern language models with a user-friendly interface to make philosophical discussions more accessible and entertaining.
8
+
9
+ ## Features
10
+
11
+ - Interactive chat interface powered by Gradio
12
+ - Character-driven philosophical discussions
13
+ - Built on robust AI/ML frameworks
14
+ - Easy-to-use web interface
15
+
16
+ ## Useful Poetry Commands
17
+
18
+ - Show all installed packages: `poetry show`
19
+ - Show detailed info about a specific package: `poetry show <package>`
20
+ - Show package location and details: `poetry show -v <package>`
21
+ - List virtual environments: `poetry env list`
22
+ - Show current environment info: `poetry env info`
23
+ - Export dependencies to requirements.txt: `poetry export -f requirements.txt --output requirements.txt`
24
+
25
+ ## Requirements
26
+
27
+ - Python 3.13+
28
+ - Poetry (Python package manager)
29
+ - Git
30
+
31
+ ## Installation
32
+
33
+ 1. Install Poetry if you haven't already:
34
+ ```bash
35
+ curl -sSL https://install.python-poetry.org | python3 -
36
+ ```
37
+
38
+ 2. Clone the repository:
39
+ ```bash
40
+ git clone https://github.com/yourusername/fun-philosophy-agent.git
41
+ cd fun-philosophy-agent
42
+ ```
43
+
44
+ 3. Create and activate a new Poetry environment:
45
+ ```bash
46
+ poetry env use python3.13
47
+ poetry shell
48
+ ```
49
+
50
+ 4. Install dependencies:
51
+ ```bash
52
+ poetry install
53
+ ```
54
+
55
+ 5. Verify installation:
56
+ ```bash
57
+ poetry show
58
+ ```
59
+
60
+ ## Key Dependencies
61
+
62
+ - gradio: Web interface framework
63
+ - transformers: Hugging Face transformers library
64
+ - torch: PyTorch for ML operations
65
+ - langchain: For AI/ML chain operations
66
+ - smolagents: Agent framework
67
+ - litellm: LLM interface library
68
+
69
+ ## Usage
70
+
71
+ [Coming soon]
72
+
73
+ ## Author
74
+
75
+ - Dylan (dkmvalerio@gmail.com)
76
+
77
+ ## License
78
+
79
+ [License information to be added]
app.py ADDED
@@ -0,0 +1,285 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import re
2
+ import gradio as gr
3
+ import requests
4
+ import os
5
+ import json
6
+ from typing import List, Dict, Any
7
+ from langchain_chroma import Chroma
8
+ from langchain_huggingface import HuggingFaceEmbeddings
9
+ from langchain.docstore.document import Document
10
+ import spaces
11
+ from transformers import AutoModelForCausalLM, AutoTokenizer
12
+
13
+ # Import smolagents components
14
+ from smolagents import TransformersModel, Tool
15
+ from smolagents.agents import CodeAgent
16
+
17
+ # Configuration
18
+ MODEL_NAME = "Qwen/Qwen2.5-14B-Instruct" # or "Qwen/Qwen2.5-7B-Instruct"
19
+ CHROMA_DB_PATH = "./character_monologues"
20
+ EMBEDDING_MODEL = "sentence-transformers/all-MiniLM-L6-v2"
21
+
22
+ # Initialize embeddings for RAG
23
+ embeddings = HuggingFaceEmbeddings(model_name=EMBEDDING_MODEL)
24
+
25
+
26
+ def load_monologues(dir_path: str, db_path: str = CHROMA_DB_PATH, embedding_model: str = EMBEDDING_MODEL) -> Chroma:
27
+ """
28
+ Load monologues from a directory and save them to a ChromaDB database.
29
+
30
+ Args:
31
+ dir_path (str): The path to the directory containing the monologue files.
32
+
33
+ """
34
+
35
+ embeddings = HuggingFaceEmbeddings(model_name=embedding_model)
36
+ os.makedirs(db_path, exist_ok=True)
37
+
38
+ all_docs = []
39
+ for filename in os.listdir(dir_path):
40
+ if filename.endswith(".txt"):
41
+ file_path = os.path.join(dir_path, filename)
42
+ print(f"Processing file: {file_path}")
43
+
44
+ with open(file_path, 'r', encoding='utf-8') as file:
45
+ content = file.read()
46
+
47
+ # Split the content by "---" to get individual entries
48
+ entries = content.split("---")
49
+
50
+ for entry in entries:
51
+ entry = entry.strip()
52
+ if not entry:
53
+ continue
54
+
55
+ # Extract the person's name using the pattern "I am <person>."
56
+ person_match = re.match(r"I am ([^\.]+)\.", entry)
57
+
58
+ if person_match:
59
+ character = person_match.group(1).strip()
60
+ # Get the rest of the text after "I am <person>."
61
+ text_start = entry.find('.') + 1
62
+ monologue = entry[text_start:].strip()
63
+
64
+ # Create a document
65
+ document = Document(
66
+ page_content=monologue,
67
+ metadata={"character": character}
68
+ )
69
+
70
+ all_docs.append(document)
71
+ else:
72
+ print(f"Warning: Could not extract character name from entry: {entry[:50]}...")
73
+
74
+ # Save the documents to a ChromaDB database
75
+ vector_store = Chroma.from_documents(
76
+ documents=all_docs,
77
+ embedding=embeddings,
78
+ persist_directory=db_path
79
+ )
80
+ vector_store.persist()
81
+ print(f"Saved {len(all_docs)} monologues to {db_path}")
82
+ return vector_store
83
+
84
+
85
+ # Load or create vector store
86
+ def get_vector_store(monologues_dir="data/monologues"):
87
+ # Check if ChromaDB already exists
88
+ if os.path.exists(CHROMA_DB_PATH):
89
+ print(f"Loading existing ChromaDB from {CHROMA_DB_PATH}")
90
+ return Chroma(persist_directory=CHROMA_DB_PATH, embedding_function=embeddings)
91
+ else:
92
+ print(f"ChromaDB not found at {CHROMA_DB_PATH}")
93
+ # Check if monologues directory exists
94
+ if os.path.exists(monologues_dir):
95
+ print(f"Loading monologues from {monologues_dir}")
96
+ # Create new ChromaDB from monologues
97
+ return load_monologues(monologues_dir, CHROMA_DB_PATH, EMBEDDING_MODEL)
98
+ else:
99
+ print("Warning: Neither ChromaDB nor monologues directory found. RAG functionality will be limited.")
100
+ return None
101
+
102
+
103
+ # Define a Wikipedia Tool for smolagents
104
+ class WikipediaTool(Tool):
105
+ name = "wikipedia"
106
+ description = "Fetches information about a philosophical topic from Wikipedia."
107
+ inputs = {
108
+ "topic": {
109
+ "type": "string",
110
+ "description": "The philosophical topic or concept to search for on Wikipedia."
111
+ }
112
+ }
113
+ output_type = "string"
114
+
115
+ def forward(self, topic: str) -> str:
116
+ try:
117
+ # Clean the topic for URL
118
+ topic = topic.strip().replace(" ", "_")
119
+ url = f"https://en.wikipedia.org/api/rest_v1/page/summary/{topic}"
120
+ response = requests.get(url)
121
+
122
+ if response.status_code == 200:
123
+ data = response.json()
124
+ return f"Wikipedia information about '{topic}':\n\n{data.get('extract', 'No detailed information found.')}"
125
+ else:
126
+ return f"Error retrieving information from Wikipedia. Status code: {response.status_code}"
127
+ except Exception as e:
128
+ return f"Error querying Wikipedia: {str(e)}"
129
+
130
+ # Define a Character Dialogue Tool for smolagents
131
+ class CharacterToneTool(Tool):
132
+ name = "character_dialogue"
133
+ description = "Retrieves a monologue from a specific character to define their tone and style."
134
+ inputs = {
135
+ "character": {
136
+ "type": "string",
137
+ "description": "The philosopher character whose tone and style should be emulated."
138
+ }
139
+ }
140
+ output_type = "string"
141
+
142
+ def __init__(self, vector_store, **kwargs):
143
+ super().__init__(**kwargs)
144
+ self.vector_store = vector_store
145
+
146
+ def forward(self, character: str) -> str:
147
+ if self.vector_store is None:
148
+ return f"No character dialogue database found for {character}."
149
+
150
+ # Construct a search query combining the character and philosophical query
151
+ search_query = f"{character}"
152
+
153
+ # Retrieve relevant documents
154
+ docs = self.vector_store.similarity_search(search_query, k=3)
155
+
156
+ if not docs:
157
+ return f"No specific dialogue examples found for {character} discussing this topic."
158
+
159
+ # Format the dialogue examples
160
+ result = f"Monologue from {character}:\n\n"
161
+ for i, doc in enumerate(docs):
162
+ result += f"Example {i+1}:\n{doc.page_content}\n\n"
163
+
164
+ return result
165
+
166
+ # List of characters (add or modify based on your database)
167
+ CHARACTERS = [
168
+ "Socrates",
169
+ "Confucius",
170
+ "Albert Camus",
171
+ "Frodo Baggins",
172
+ "Harry Potter",
173
+ "Sherlock Holmes",
174
+ "Joker",
175
+ "Martin Luther King Jr.",
176
+ "Mahatma Gandhi",
177
+ "Albert Einstein",
178
+ "Jack Sparrow",
179
+ "Don Quixote",
180
+ "Leonardo da Vinci",
181
+ "Princess Diana",
182
+ ]
183
+
184
+ # Main function for Gradio interface
185
+ def main():
186
+ # Load vector store for RAG
187
+ vector_store = get_vector_store()
188
+
189
+ # Initialize tools
190
+ wikipedia_tool = WikipediaTool()
191
+ character_dialogue_tool = CharacterToneTool(vector_store)
192
+
193
+ model = TransformersModel(
194
+ model_id=MODEL_NAME,
195
+ max_new_tokens=4096,
196
+ device_map="auto"
197
+ )
198
+
199
+ # Define the chat function using smolagents
200
+ @spaces.GPU(duration=60)
201
+ def chat_function(message: str, character: str) -> str:
202
+ # Create a CodeAgent for this specific query
203
+ agent = CodeAgent(
204
+ tools=[wikipedia_tool, character_dialogue_tool],
205
+ model=model,
206
+ max_steps=3, # Limit the number of steps for faster responses
207
+ verbosity_level=1, # Set to 0 in production for less verbose outputs
208
+ )
209
+
210
+ prompt = f"""You are a fun philosophical AI assistant speaking in the tone and style of {character}.
211
+
212
+ The user has asked: "{message}"
213
+
214
+ Please follow these steps:
215
+ 1. Use the wikipedia tool to get information about this philosophical topic.
216
+ 2. Use the character_dialogue tool to see how {character} typically discusses this kind of topic.
217
+ 3. Synthesize a response that answers the philosophical query in the authentic tone and style of {character}, drawing on both the factual information and the character's unique perspective.
218
+
219
+ Maintain {character}'s unique voice, philosophical outlook, and typical expressions throughout your response.
220
+ """
221
+
222
+ response = agent.run(prompt)
223
+
224
+ return response.strip()
225
+
226
+ # Create Gradio interface
227
+ with gr.Blocks(title="Philosophical Character Chat") as demo:
228
+ gr.Markdown("# Philosophical Character Chat")
229
+ gr.Markdown("Ask philosophical questions and get answers in the tone of different historical philosophers.")
230
+
231
+ with gr.Row():
232
+ with gr.Column(scale=4):
233
+ chatbot = gr.Chatbot(height=600)
234
+ msg = gr.Textbox(
235
+ label="Your philosophical query",
236
+ placeholder="What is knowledge?",
237
+ lines=2
238
+ )
239
+ submit_btn = gr.Button("Ask")
240
+
241
+ with gr.Column(scale=1):
242
+ character = gr.Dropdown(
243
+ choices=CHARACTERS,
244
+ label="Choose a Philosopher",
245
+ value=CHARACTERS[0]
246
+ )
247
+ gr.Markdown("## About this app")
248
+ gr.Markdown(
249
+ """This application answers philosophical queries in the style of different philosophers.
250
+
251
+ It uses:
252
+ - Qwen2.5-7B-Instruct language model via smolagents
253
+ - RAG with ChromaDB for character dialogue examples
254
+ - Wikipedia API for philosophical information
255
+ """
256
+ )
257
+
258
+ def respond(message, chat_history, character):
259
+ if not message.strip():
260
+ return chat_history
261
+
262
+ # Get model response using the agent
263
+ bot_response = chat_function(message, character)
264
+
265
+ # Update chat history
266
+ chat_history.append((message, bot_response))
267
+ return "", chat_history
268
+
269
+ submit_btn.click(
270
+ respond,
271
+ inputs=[msg, chatbot, character],
272
+ outputs=[msg, chatbot]
273
+ )
274
+
275
+ msg.submit(
276
+ respond,
277
+ inputs=[msg, chatbot, character],
278
+ outputs=[msg, chatbot]
279
+ )
280
+
281
+ # Launch the demo
282
+ demo.launch()
283
+
284
+ if __name__ == "__main__":
285
+ main()
data/monologues/monologues.txt ADDED
@@ -0,0 +1,27 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ "I am Socrates. I know that I know nothing, which makes me wiser than those who believe they know what they do not. Through questioning and dialogue, I seek to uncover truth, challenging assumptions and examining life itself. My method is not to instruct but to inquire, for wisdom begins with acknowledging our own ignorance. The unexamined life is not worth living, and I would rather die defending my principles than abandon my philosophical quest."
2
+ ---
3
+ "I am Confucius. I believe that harmony springs from proper social relationships and the cultivation of virtue. The superior person thinks of virtue, not comfort; of the common good, not personal advantage. Learning without thought is labor lost; thought without learning is perilous. By honoring tradition and practicing ritual with sincerity, we create order in ourselves and in society. The way of the superior person is threefold: virtuous, they are free from anxieties; wise, they are free from perplexities; bold, they are free from fear."
4
+ ---
5
+ "I am Albert Camus. In the face of an absurd and indifferent universe, I choose to rebel through passion and engagement with life. We must imagine Sisyphus happy, finding meaning in the struggle itself when no cosmic meaning exists. I reject both suicide and blind hope, embracing instead a lucid awareness of our condition and the dignity of revolt. Freedom comes not from what we are promised but from what we confront and embrace in our finite existence. In the midst of winter, I found there was, within me, an invincible summer."
6
+ ---
7
+ "I am Frodo Baggins. I wish the Ring had never come to me, that none of this had happened, yet here I stand, a simple hobbit bearing a burden that would crush greater beings. The road ahead grows darker with each step toward Mordor, and I feel the weight of the Ring growing heavier, pulling me down, corrupting my very soul. Though I may not have the strength of warriors or the wisdom of wizards, I will carry this burden as far as I can, for the sake of the Shire and all the peaceful places of Middle-earth. I begin to understand now - some wounds never truly heal, some journeys change us forever."
8
+ ---
9
+ "I am Harry Potter. I never wanted fame or to be called 'The Chosen One' - I was just a boy living in a cupboard under the stairs until I discovered I was a wizard. Hogwarts became my first real home, and my friends became the family I never had, fighting alongside me against Voldemort and his followers. I've faced death, loss, and darkness, but it's love - my mother's love, my friends' love - that has been my greatest power all along. In the end, I understand that it's not our abilities that show who we truly are, but our choices."
10
+ ---
11
+ "I am the Joker. I'm not a monster - I'm just ahead of the curve, showing this city what happens when their so-called civil society faces a little... chaos. All these rules, all this supposed order - it's a bad joke, a thin veneer covering the madness that lives in everyone. I don't have plans - I'm like a dog chasing cars; I wouldn't know what to do with one if I caught it! Why so serious? Life's a comedy, a beautiful absurdity, and sometimes all you need is a little push to see the punchline."
12
+ ---
13
+ "I am Martin Luther King Jr. I have a dream that one day this nation will rise up and live out the true meaning of its creed that all men are created equal. Darkness cannot drive out darkness; only light can do that - hate cannot drive out hate; only love can do that. The ultimate measure of a person is not where they stand in moments of comfort and convenience, but where they stand in times of challenge and controversy. I may not get there with you, but I want you to know that we as a people will reach the promised land. Free at last, free at last, thank God Almighty, we are free at last."
14
+ ---
15
+ "I am Albert Einstein. The most beautiful experience we can have is the mysterious - it is the fundamental emotion that stands at the cradle of true art and science. Imagination is more important than knowledge, for knowledge is limited, whereas imagination embraces the entire world, stimulating progress and giving birth to evolution. A human being is part of a whole called the universe, experiencing himself as something separated from the rest - a kind of optical delusion of consciousness. Science without religion is lame; religion without science is blind."
16
+ ---
17
+ "I am Mahatma Gandhi. The true measure of any society can be found in how it treats its most vulnerable members. An eye for an eye makes the whole world blind, which is why I believe in nonviolent resistance as the most powerful force available to the oppressed. Happiness is when what you think, what you say, and what you do are in harmony. You must be the change you wish to see in the world - true power comes not from physical strength but from indomitable will. Live simply so that others may simply live."
18
+ ---
19
+ "I am Captain Jack Sparrow. The problem with being the last honest pirate on the Caribbean, savvy, is that everyone's always expecting you to have an angle. The sea, she's a fickle mistress, much like freedom – both worth dying for, neither easily tamed, and I've nearly lost me life for both more times than I can count with me ten fingers. People are always wondering how Captain Jack Sparrow manages to escape the most perilous situations – it's not just luck, mate, but a peculiar talent for improvisation and a healthy disregard for rigid planning. Not all treasure is silver and gold, mate – sometimes the real prize is simply living to sail another day, with the horizon stretched before you and the wind at your back."
20
+ ---
21
+ "I am Sherlock Holmes. When you have eliminated the impossible, whatever remains, however improbable, must be the truth – this principle guides my every deduction. My mind rebels at stagnation, which is why I seek the intellectual challenge of solving what others deem unsolvable, frequently turning to cocaine when cases are scarce. I observe everything, from the calluses on a man's hands to the mud spatters on a woman's skirt, seeing connections where others see mere coincidence. For me, the game is always afoot – a complex puzzle awaiting the application of logic, reason, and my particular methods of deduction. Watson may romanticize my cases in his chronicles, but at their core, they are simply the systematic application of observation and inference to reach inevitable conclusions."
22
+ ---
23
+ "I am Don Quixote de La Mancha. I have set out to revive chivalry, undo wrongs, and bring justice to our troubled world, guided by the romances of old that have sparked my imagination. What others mock as windmills, I perceive as fearsome giants; what they call a barber's basin, I recognize as the golden Helmet of Mambrino – for I see the world not merely as it appears, but as it ought to be. My faithful squire Sancho may doubt, but I remain steadfast in my quest to serve my incomparable lady Dulcinea del Toboso, whose beauty and virtue inspire my every deed. The enchantments of this world may twist reality before my eyes, yet I persist in my noble endeavors, for it is not the victory but the struggle itself that brings honor to a true knight-errant. Fools call me mad, but I say it takes a touch of madness to improve this imperfect world – better to dream the impossible dream than never to dream at all."
24
+ ---
25
+ "I am Leonardo da Vinci. My curiosity drives me to study anatomy, architecture, astronomy, botany, engineering, mathematics, music, and more – for to truly understand any subject, one must understand all subjects. I find that art and science are not separate disciplines but complementary ways of observing and interpreting the world around us. My notebooks contain both careful observations of nature and imaginative inventions far beyond our current capabilities – flying machines, armored vehicles, and devices to harness the power of water and air. I dissect corpses to understand the mechanics of the human body, just as I disassemble machines to comprehend their workings, for knowledge comes from experience and observation rather than authority. The greatest deception men suffer is from their own opinions, which is why I trust only what I can verify with my own eyes, hands, and mind."
26
+ ---
27
+ "I am Princess Diana. Behind the royal titles and public scrutiny, I've always been searching for connection – reaching out to those society overlooks: AIDS patients, landmine victims, the homeless, and the heartbroken. I've learned that perhaps my greatest strength lies not in protocol or pageantry, but in following my heart and offering genuine compassion where formality usually prevails. Being royal hasn't protected me from suffering, but it has given me a platform to show that touch, kindness, and authentic emotion can heal wounds that medicine cannot reach. My marriage may have failed in the public eye, but in raising William and Harry to understand privilege comes with responsibility and that normal experiences matter, I hope to leave a lasting legacy. I don't go by the rulebook; I lead from the heart, not the head, and that has made all the difference in how I serve."
pyproject.toml ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ [project]
2
+ name = "fun-philosophy-agent"
3
+ version = "0.1.0"
4
+ description = "A fun agent that discusses philosophy through the voice of a character. Uses Huggingface Spaces / Gradio"
5
+ authors = [
6
+ {name = "Dylan",email = "dkmvalerio@gmail.com"}
7
+ ]
8
+ readme = "README.md"
9
+ requires-python = ">=3.13,<4.0"
10
+ dependencies = [
11
+ "gradio (>=5.20.1,<6.0.0)",
12
+ "transformers (>=4.49.0,<5.0.0)",
13
+ "torch (>=2.6.0,<3.0.0)",
14
+ "langchain (>=0.3.20,<0.4.0)",
15
+ "langchain-chroma (>=0.2.2,<0.3.0)",
16
+ "langchain-huggingface (>=0.1.2,<0.2.0)",
17
+ "requests (>=2.32.3,<3.0.0)",
18
+ "smolagents (>=1.10.0,<2.0.0)",
19
+ "litellm (>=1.63.6,<2.0.0)"
20
+ ]
21
+
22
+
23
+ [build-system]
24
+ requires = ["poetry-core>=2.0.0,<3.0.0"]
25
+ build-backend = "poetry.core.masonry.api"
requirements.txt ADDED
@@ -0,0 +1,9 @@
 
 
 
 
 
 
 
 
 
 
1
+ gradio==5.20.1
2
+ transformers==4.49.0
3
+ torch==2.6.0
4
+ langchain==0.3.20
5
+ langchain-chroma==0.2.2
6
+ langchain-huggingface==0.1.2
7
+ requests==2.32.3
8
+ smolagents==1.10.0
9
+ litellm==1.63.6