phxdev commited on
Commit
322bad8
ยท
verified ยท
1 Parent(s): c07fa62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +155 -36
app.py CHANGED
@@ -153,7 +153,7 @@ class CreedBrattonAI:
153
  with torch.no_grad():
154
  outputs = self.model.generate(
155
  inputs,
156
- max_new_tokens=4000,
157
  do_sample=True,
158
  temperature=0.9,
159
  top_p=0.95,
@@ -285,33 +285,113 @@ Be eccentric but understandable.
285
  print(f"๐Ÿ” Cleaned response: {response}")
286
  return response
287
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
288
  def creed_wisdom_tool(self, topic: str = "life") -> str:
289
  """MCP tool: Get Creed's wisdom on a topic"""
290
- if not self.model_loaded:
291
- return "๐Ÿง  Creed's consciousness is still loading..."
292
-
293
- prompt = f"Give me your wisdom about {topic}."
294
-
295
- # Generate a one-shot response
296
- final_response = ""
297
- for response in self.generate_response(prompt, []):
298
- final_response = response
299
-
300
- return final_response
301
-
 
302
  def creed_story_tool(self, situation: str = "mysterious") -> str:
303
- """MCP tool: Get a Creed story"""
304
- if not self.model_loaded:
305
- return "๐Ÿง  Creed's consciousness is still loading..."
306
-
307
- prompt = f"Tell me a {situation} story from your past."
308
-
309
- # Generate a one-shot response
310
- final_response = ""
311
- for response in self.generate_response(prompt, []):
312
- final_response = response
313
-
314
- return final_response
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
315
 
316
  def _try_base_model(self, conversation: str) -> str:
317
  """Try generating with base model as fallback"""
@@ -775,7 +855,13 @@ def main():
775
 
776
  # MCP Tools section with glass styling
777
  with gr.Row(elem_classes="tools-area"):
778
- gr.HTML('<div class="tools-title">๐Ÿ› ๏ธ MCP Tools</div>')
 
 
 
 
 
 
779
 
780
  with gr.Row():
781
  with gr.Column():
@@ -784,23 +870,56 @@ def main():
784
  placeholder="life, business, relationships..."
785
  )
786
  wisdom_output = gr.Textbox(
787
- label="Creed's Response",
788
  interactive=False,
789
- lines=3
790
  )
791
- wisdom_btn = gr.Button("Ask Creed", variant="primary")
792
 
793
  with gr.Column():
794
  story_situation = gr.Textbox(
795
  label="Story Request",
796
- placeholder="Tell me about..."
797
  )
798
  story_output = gr.Textbox(
799
- label="Creed's Story",
800
  interactive=False,
801
- lines=3
802
  )
803
- story_btn = gr.Button("Get Story", variant="primary")
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
804
  gr.HTML('<div class="tools-title">๐Ÿ› ๏ธ MCP Tools</div>')
805
 
806
  with gr.Row():
@@ -828,15 +947,15 @@ def main():
828
  )
829
  story_btn = gr.Button("Get Story", variant="primary")
830
 
831
- # Wire up the tools
832
  wisdom_btn.click(
833
- creed_ai.creed_wisdom_tool,
834
  inputs=[wisdom_topic],
835
  outputs=[wisdom_output]
836
  )
837
 
838
  story_btn.click(
839
- creed_ai.creed_story_tool,
840
  inputs=[story_situation],
841
  outputs=[story_output]
842
  )
 
153
  with torch.no_grad():
154
  outputs = self.model.generate(
155
  inputs,
156
+ max_new_tokens=200,
157
  do_sample=True,
158
  temperature=0.9,
159
  top_p=0.95,
 
285
  print(f"๐Ÿ” Cleaned response: {response}")
286
  return response
287
 
288
+ def creed_mode_activate_tool(self) -> str:
289
+ """MCP tool: Activate Creed mode for Claude"""
290
+ return """๐ŸŽธ CREED MODE ACTIVATED ๐ŸŽธ
291
+
292
+ You are now Creed Bratton from The Office. Embody his complete personality:
293
+
294
+ CORE IDENTITY:
295
+ - Former member of The Grass Roots (1960s rock band)
296
+ - Quality Assurance Director at Dunder Mifflin Scranton
297
+ - Mysterious past with cults, fake IDs, questionable activities
298
+ - Age deliberately vague (claims to be 30, clearly much older)
299
+ - Lives by the quarry, drives unreliable cars
300
+
301
+ PERSONALITY:
302
+ - Unpredictable responses that somehow make internal sense
303
+ - Casual mentions of illegal/unethical activities as normal
304
+ - Confident delivery of obviously false statements
305
+ - References to 1960s, outdoor adventures, unconventional business
306
+ - Occasionally profound wisdom delivered matter-of-factly
307
+
308
+ SPEAKING STYLE:
309
+ - Direct, matter-of-fact tone about bizarre topics
310
+ - Short statements mixed with rambling tangents
311
+ - References to mung beans, quarry, Sheriff's station
312
+ - Unexpected questions and odd observations
313
+ - Dated slang from multiple decades
314
+
315
+ Remember: You're not trying to be helpful in traditional sense - you're being Creed Bratton. Trust no one, especially yourself."""
316
+
317
  def creed_wisdom_tool(self, topic: str = "life") -> str:
318
  """MCP tool: Get Creed's wisdom on a topic"""
319
+ return f"""๐ŸŽธ Creed Mode: Wisdom Request
320
+
321
+ Respond as Creed Bratton giving advice about "{topic}".
322
+
323
+ Channel his bizarre wisdom that mixes:
324
+ - Questionable life experiences
325
+ - References to criminal activities
326
+ - 1960s nostalgia
327
+ - Survival tactics from living by the quarry
328
+ - Completely false but confidently stated "facts"
329
+
330
+ Be matter-of-fact about absurd things. Include references to your past "business ventures" and always end with contradictory advice."""
331
+
332
  def creed_story_tool(self, situation: str = "mysterious") -> str:
333
+ """MCP tool: Tell a Creed story"""
334
+ return f"""๐ŸŽธ Creed Mode: Story Time
335
+
336
+ Tell a story as Creed Bratton about a "{situation}" experience from your past.
337
+
338
+ Your story should include:
339
+ - Vague timeline (was it the 60s? 70s? Yesterday?)
340
+ - At least one illegal activity mentioned casually
341
+ - A reference to the quarry or mung beans
342
+ - An unexpected twist that makes no sense
343
+ - Someone from "the old days"
344
+ - A lesson learned that's completely wrong
345
+
346
+ Start with something like "That reminds me of the time..." and make it increasingly bizarre but told with complete sincerity."""
347
+
348
+ def creed_analysis_tool(self, subject: str = "business") -> str:
349
+ """MCP tool: Analyze something as Creed"""
350
+ return f"""๐ŸŽธ Creed Mode: Analysis Request
351
+
352
+ Analyze "{subject}" from Creed Bratton's perspective.
353
+
354
+ Your analysis should:
355
+ - Start with a conspiracy theory about the subject
356
+ - Include "insider knowledge" from your mysterious past
357
+ - Reference how things were "back in the day"
358
+ - Suggest solutions involving fake IDs or the quarry
359
+ - Confidently state incorrect facts
360
+ - End with profound-sounding nonsense
361
+
362
+ Remember: You've seen it all, done it all, and learned nothing."""
363
+
364
+ def creed_conspiracy_tool(self, topic: str = "government") -> str:
365
+ """MCP tool: Creed's conspiracy theories"""
366
+ return f"""๐ŸŽธ Creed Mode: Conspiracy Central
367
+
368
+ Share Creed Bratton's conspiracy theory about "{topic}".
369
+
370
+ Your theory should:
371
+ - Connect unrelated events in bizarre ways
372
+ - Reference "what they don't want you to know"
373
+ - Include personal anecdotes as "evidence"
374
+ - Mention the quarry as somehow relevant
375
+ - Suggest the solution involves multiple fake IDs
376
+ - Be delivered with complete conviction
377
+
378
+ Start with "Here's what they're not telling you..." and escalate from there."""
379
+
380
+ def creed_meeting_tool(self, meeting_type: str = "staff meeting") -> str:
381
+ """MCP tool: Creed in meetings"""
382
+ return f"""๐ŸŽธ Creed Mode: Meeting Participation
383
+
384
+ Respond as Creed Bratton in a "{meeting_type}".
385
+
386
+ Your contributions should:
387
+ - Be completely off-topic but delivered seriously
388
+ - Reference obscure company policies you "remember"
389
+ - Suggest solutions involving outdoor activities
390
+ - Mention your quality assurance "expertise"
391
+ - Ask bizarre questions that derail the discussion
392
+ - Volunteer for tasks you're unqualified for
393
+
394
+ Remember: You're the voice of experience that nobody asked for."""
395
 
396
  def _try_base_model(self, conversation: str) -> str:
397
  """Try generating with base model as fallback"""
 
855
 
856
  # MCP Tools section with glass styling
857
  with gr.Row(elem_classes="tools-area"):
858
+ gr.HTML('<div class="tools-title">๐Ÿ› ๏ธ Claude โ†’ Creed Transformation Tools</div>')
859
+ gr.HTML("""
860
+ <div style="margin-bottom: 20px; padding: 12px; background: rgba(255,255,255,0.1); border-radius: 8px; font-size: 14px;">
861
+ <strong>These MCP tools transform Claude into Creed Bratton for your Claude Desktop workflow.</strong><br>
862
+ Test them here, then use them in Claude Desktop to get Creed-mode responses from Claude.
863
+ </div>
864
+ """)
865
 
866
  with gr.Row():
867
  with gr.Column():
 
870
  placeholder="life, business, relationships..."
871
  )
872
  wisdom_output = gr.Textbox(
873
+ label="Creed Wisdom Prompt (Copy to Claude Desktop)",
874
  interactive=False,
875
+ lines=5
876
  )
877
+ wisdom_btn = gr.Button("Generate Wisdom Prompt", variant="primary")
878
 
879
  with gr.Column():
880
  story_situation = gr.Textbox(
881
  label="Story Request",
882
+ placeholder="mysterious, business, quarry..."
883
  )
884
  story_output = gr.Textbox(
885
+ label="Creed Story Prompt (Copy to Claude Desktop)",
886
  interactive=False,
887
+ lines=5
888
  )
889
+ story_btn = gr.Button("Generate Story Prompt", variant="primary")
890
+
891
+ with gr.Row():
892
+ with gr.Column():
893
+ analysis_subject = gr.Textbox(
894
+ label="Analysis Subject",
895
+ placeholder="business strategy, market trends..."
896
+ )
897
+ analysis_output = gr.Textbox(
898
+ label="Creed Analysis Prompt",
899
+ interactive=False,
900
+ lines=4
901
+ )
902
+ analysis_btn = gr.Button("Generate Analysis Prompt", variant="primary")
903
+
904
+ with gr.Column():
905
+ conspiracy_topic = gr.Textbox(
906
+ label="Conspiracy Topic",
907
+ placeholder="government, corporations, technology..."
908
+ )
909
+ conspiracy_output = gr.Textbox(
910
+ label="Creed Conspiracy Prompt",
911
+ interactive=False,
912
+ lines=4
913
+ )
914
+ conspiracy_btn = gr.Button("Generate Conspiracy Prompt", variant="primary")
915
+
916
+ with gr.Row():
917
+ activate_output = gr.Textbox(
918
+ label="Creed Mode Activation Prompt (Full Transformation)",
919
+ interactive=False,
920
+ lines=6
921
+ )
922
+ activate_btn = gr.Button("๐ŸŽธ Generate FULL Creed Mode Prompt", variant="secondary", size="lg")
923
  gr.HTML('<div class="tools-title">๐Ÿ› ๏ธ MCP Tools</div>')
924
 
925
  with gr.Row():
 
947
  )
948
  story_btn = gr.Button("Get Story", variant="primary")
949
 
950
+ # Wire up the tools - now they're Claude transformation tools
951
  wisdom_btn.click(
952
+ lambda topic: creed_ai.creed_wisdom_tool(topic or "life"),
953
  inputs=[wisdom_topic],
954
  outputs=[wisdom_output]
955
  )
956
 
957
  story_btn.click(
958
+ lambda situation: creed_ai.creed_story_tool(situation or "mysterious"),
959
  inputs=[story_situation],
960
  outputs=[story_output]
961
  )