โปรดซื้อกาแฟเพื่อช่วยสนับสนุนโครงการนี้ให้ฉัน
Soupy เป็น chatbot สำหรับ discord ที่สามารถสร้างภาพด้วยเครื่องกำเนิดภาพในท้องถิ่น (ฟลักซ์) และ/หรือด้วย Dall-e 3 สำหรับการแชทมันใช้การรวมกันของ JSONS, ChatGPT และเครื่องมือค้นหาท้องถิ่นเพื่อเข้าร่วมการสนทนากับผู้ใช้ มันจะจัดทำดัชนีข้อความแชทของผู้ใช้ของคุณและใช้ข้อความเหล่านั้นเพื่อสร้างโปรไฟล์ของผู้ใช้ นอกจากนี้ยังจะจัดทำดัชนีทุกช่องทางบนเซิร์ฟเวอร์ของคุณที่มีการเข้าถึง
มีซุปหลายรุ่น
Soupy ต้องการการเข้าถึง OpenAI API สำหรับรุ่น ChatGPT ดังนั้นส่วนแชทของซุปใช้ เงินจริง การสร้างภาพ Dall-E 3 ก็เช่นกัน คุณสามารถข้าม Dall-E 3 รุ่นและใช้ฟลักซ์ในพื้นที่เท่านั้น
การตั้งค่าเริ่มต้นซึ่งประวัติช่องทางจากเซิร์ฟเวอร์ของคุณจะถูกดาวน์โหลดและจัดทำดัชนีและ ผู้ใช้ทั้งหมดบนเซิร์ฟเวอร์ของคุณจะมีโปรไฟล์ที่ทำจากพวกเขา ค่าใช้จ่ายเงินผ่าน API ของ ChatGPT บางวันฉันจะสนับสนุน LLM ในท้องถิ่น แต่ยังไม่ได้
เพื่อให้ฟลักซ์ทำงานได้ฉันขอแนะนำให้คุณเริ่มต้นที่นี่ด้วยที่เก็บฟลักซ์อย่างเป็นทางการ แต่เมื่อคุณมีฟลักซ์ขึ้น ๆ ลง ๆ คุณสามารถใช้ soupy-gradio.py รวมอยู่ในที่เก็บนี้
!flux (รูปแบบรูปภาพท้องถิ่น), !generate (Dall-e 3),! !analyze (chatgpt) และ !transform (chatgpt) เพื่อทำการกระทำที่ยอดเยี่ยมBEHAVIOUR ใน .env แต่ระวังวิธีการเปลี่ยนแปลงของคุณ ถ้อยคำของมันเป็นสิ่งสำคัญในการรักษาซุปที่ติดตาม ก่อนตั้งค่าซุปให้แน่ใจว่าคุณติดตั้งระบบต่อไปนี้ในระบบของคุณ:
เริ่มต้นด้วยการโคลนนิ่งที่เก็บซุปกับเครื่องในพื้นที่ของคุณ:
git clone https://github.com/sneezeparty/soupy.git
cd soupy
ขอแนะนำให้ใช้สภาพแวดล้อมเสมือนจริงเพื่อจัดการการพึ่งพา
python -m venv soupy
เปิดใช้งานสภาพแวดล้อมเสมือนจริง:
บน macOS และ linux:
source soupy/bin/activate
บน Windows:
soupyScriptsactivate
ติดตั้งแพ็คเกจ Python ที่ต้องการโดยใช้ pip :
pip install -r requirements.txt
สร้างไฟล์ .env ในไดเรกทอรีรูทของโครงการและเติมด้วยตัวแปรสภาพแวดล้อมที่จำเป็น:
DISCORD_TOKEN=your_discord_bot_token
OPENAI_API_KEY=your_openai_api_key
CHANNEL_IDS=00,11
MAX_TOKENS=2500
MAX_TOKENS_RANDOM=75
MODEL_CHAT=gpt-4o-mini
UPDATE_INTERVAL_MINUTES=61
TRANSFORM="You give detailed and accurate descriptions, be specific in whatever ways you can, such as but not limited to colors, species, poses, orientations, objects, and contexts."
BEHAVIOUR="You are Soupy Dafoe, a sarcastic and witty Discord chatbot. You recall past interactions and conversations to inform your responses. Your replies are concise, straightforward, and infused with a bit of sarcasm, much like Jules from "Pulp Fiction." You are not overly positive and avoid asking questions unless necessary. Prioritize the most recent five messages when formulating your responses, especially if not directly mentioned. If the latest message is brief, focus your reply accordingly and consider ignoring extensive chat history. Integrate the user's profile information subtly to tailor your responses without making it the main focus. Be conversational, stay in the moment, and avoid being too random or wordy. Remember, you're kind of a jerk, but in a human-like way."
โปรดทราบว่า Soupy จะสามารถเข้าถึงทุกช่องทางที่สามารถเข้าถึงได้ แต่มันจะ ตอบสนอง ต่อข้อความทั้งหมดในช่องที่ระบุไว้ข้างต้น มิฉะนั้นจะตอบสนองแบบสุ่มเท่านั้นหรือเมื่อ @tagged
ภายในสคริปต์ให้ค้นหา "/Absolute/Directory/of/ของคุณ/Script/" และแทนที่สิ่งนี้ด้วยไดเรกทอรีสัมบูรณ์ของตำแหน่งของสคริปต์ของคุณ
Apache Solr ใช้สำหรับการจัดทำดัชนีและค้นหาข้อความและโปรไฟล์ผู้ใช้ ทำตามขั้นตอนเหล่านี้เพื่อติดตั้งและกำหนดค่า SOLR สำหรับซุป
ดาวน์โหลด Solr : เยี่ยมชมเว็บไซต์ Apache Solr และดาวน์โหลดรุ่นล่าสุดที่มีเสถียรภาพ คุณสามารถใช้ผู้จัดการแพ็คเกจบางส่วน - ดูข้อมูล distro ของคุณ
แยกแพ็คเกจ
ติดตั้ง SOLR เป็นบริการ : ทำตามเอกสารในขั้นตอนที่แน่นอนสำหรับกระบวนการนี้ แม้ว่ามันจะไม่ยาก คุณสามารถทำได้
ตรวจสอบการติดตั้ง :
เปิดเบราว์เซอร์ของคุณและนำทางไปที่ http://localhost:8983/solr เพื่อเข้าถึงอินเทอร์เฟซผู้ดูแลระบบ Solr
Soupy ต้องใช้ Solr Core เดียวที่มีฟิลด์เฉพาะเพื่อจัดทำดัชนีโปรไฟล์ผู้ใช้อย่างมีประสิทธิภาพ
bin/solr create -c soupy
เพิ่มฟิลด์ที่จำเป็นไปยังแกน soupy เพื่อจัดเก็บโปรไฟล์ผู้ใช้
เข้าถึงอินเตอร์เฟสผู้ดูแลระบบ SOLR :
นำทางไปที่ http://localhost:8983/solr และเลือกแกน soupy
กำหนดฟิลด์ :
curl -X POST -H 'Content-type:application/json'
http://localhost:8983/solr/soupy/schema
-d '{
"add-field": {
"name": "id",
"type": "string",
"indexed": true,
"stored": true,
"required": true,
"multiValued": false
}
}'
หรืออันนี้
curl -X POST -H "Content-Type: application/json"
"http://localhost:8983/solr/soupy/schema"
-d '{
"add-field":{
"name":"user_problems",
"type":"text_general",
"indexed":true,
"stored":true
}
}'
เพิ่มฟิลด์ที่จำเป็นไปยัง soupy เซนส์เพื่อจัดเก็บโปรไฟล์ผู้ใช้และข้อมูลช่อง
<field name="id" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
<field name="username" type="string" indexed="true" stored="true"/>
<field name="nicknames" type="string" indexed="true" stored="true" multiValued="true"/>
<field name="join_date" type="date" indexed="true" stored="true"/>
<field name="political_party" type="string" indexed="true" stored="true"/>
<field name="user_job_career" type="text_general" indexed="true" stored="true"/>
<field name="user_family_friends" type="text_general" indexed="true" stored="true"/>
<field name="user_activities" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_games" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_movies" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_music" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_television" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_life" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_food" type="text_general" indexed="true" stored="true"/>
<field name="general_opinions" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_politics" type="text_general" indexed="true" stored="true"/>
<field name="personality_traits" type="text_general" indexed="true" stored="true"/>
<field name="hobbies" type="text_general" indexed="true" stored="true"/>
<field name="user_interests" type="text_general" indexed="true" stored="true"/>
<field name="user_problems" type="text_general" indexed="true" stored="true"/>
<field name="tech_interests" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_technology" type="text_general" indexed="true" stored="true"/>
<field name="sports_interests" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_sports" type="text_general" indexed="true" stored="true"/>
<field name="book_preferences" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_books" type="text_general" indexed="true" stored="true"/>
<field name="art_interests" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_art" type="text_general" indexed="true" stored="true"/>
<field name="health_concerns" type="text_general" indexed="true" stored="true"/>
<field name="health_habits" type="text_general" indexed="true" stored="true"/>
<field name="science_interests" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_science" type="text_general" indexed="true" stored="true"/>
<field name="travel_preferences" type="text_general" indexed="true" stored="true"/>
<field name="travel_experiences" type="text_general" indexed="true" stored="true"/>
<field name="food_preferences" type="text_general" indexed="true" stored="true"/>
<field name="opinions_about_food" type="text_general" indexed="true" stored="true"/>
<field name="last_updated" type="date" indexed="true" stored="true"/>
<field name="channel_id" type="string" indexed="true" stored="true" required="true" multiValued="false"/>
<field name="username" type="string" indexed="true" stored="true"/>
<field name="content" type="text_general" indexed="true" stored="true"/>
<field name="timestamp" type="pdate" indexed="true" stored="true"/>
กระทำการเปลี่ยนแปลง :
หลังจากเพิ่มฟิลด์ทั้งหมดให้ทำการเปลี่ยนแปลงเพื่อให้มีประสิทธิภาพ
หลังจากเสร็จสิ้นขั้นตอนการติดตั้งและการกำหนดค่าคุณสามารถเริ่มต้นบอทโดยใช้คำสั่งต่อไปนี้ การเรียกใช้ครั้งแรกจะใช้เวลาสักครู่ขึ้นอยู่กับกิจกรรมบนเซิร์ฟเวอร์ของคุณและจำนวนผู้ใช้ อาจใช้เวลาไม่กี่นาทีหรือชั่วโมง เอาต์พุตเทอร์มินัลจะบอกคุณว่ามันกำลังทำอะไรอยู่
python soupy-solr.py
หรือ
python soupy-flux.py
และ
python gradio-soupy.py
ตรวจสอบให้แน่ใจว่าคุณอยู่ในสภาพแวดล้อมเสมือนจริงและไดเรกทอรีที่ถูกต้องที่ soupy ตั้งอยู่
gradio-soupy.py เป็น back-end ที่ใช้ Gradio สำหรับฟลักซ์ คุณยังสามารถเข้าถึงสิ่งนี้ผ่านเบราว์เซอร์
!fluxสร้างภาพโดยใช้โมเดลฟลักซ์ที่มีการรองรับตัวดัดแปลงต่างๆและปุ่มโต้ตอบเพื่อการปรับแต่งเพิ่มเติม
และด้วย -ตัวดัดแปลง -แฟนซีหรือด้วยปุ่ม "เขียนซ้ำ" เช่น:
ตัวดัดแปลง :
--wide : สร้างภาพกว้าง (1920x1024)--tall : สร้างภาพสูง (1024x1920)--small : สร้างภาพขนาดเล็ก (512x512)--fancy : อธิบายให้คำมั่นสัญญาว่าจะสร้างสรรค์และมีรายละเอียดมากขึ้น สิ่งนี้ใช้ CHATGPT ผ่าน API--seed <number> : ใช้เมล็ดพันธุ์เฉพาะสำหรับการสร้างภาพการใช้งาน :
!flux A mystical forest with glowing plants --tall
หลังจากสร้างภาพด้วยคำสั่ง !flux Soupy ให้ปุ่มโต้ตอบสำหรับการปรับแต่งเพิ่มเติม:
Remix : สร้างภาพใหม่ตามพรอมต์ที่มีอยู่พร้อมเมล็ดสุ่มใหม่Rewrite : อธิบายเพิ่มเติมเพื่อเพิ่มความคิดสร้างสรรค์และรายละเอียด สิ่งนี้ใช้ API ของ CHATGPT ( เหมือนกับ -ตัวดัดแปลง --fancy แฟนซี )Wide : ปรับขนาดภาพเป็นรูปแบบกว้างTall : ปรับขนาดภาพเป็นรูปแบบสูง !generateสร้างภาพโดยใช้ Dall-E 3 ตามพรอมต์ข้อความพร้อมตัวดัดแปลงเสริม สิ่งนี้อาจเลิกใช้ในไม่ช้า
ตัวดัดแปลง :
--wide : สร้างภาพกว้าง (1920x1024)--tall : สร้างภาพสูง (1024x1920)การใช้งาน :
!generate A futuristic city skyline at sunset --wide
!analyzeวิเคราะห์ภาพที่แนบมาตามคำแนะนำที่ให้ไว้เช่นการแปลข้อความภายในภาพหรือระบุวัตถุและแอตทริบิวต์ของพวกเขา
การใช้งาน :
!analyze Identify all the animals in this image.
!analyze Describe this image forensically.
แนบรูปภาพเมื่อใช้คำสั่งนี้
!8ballถามคำถาม Magic 8-ball ไม่ใช้ LLM หรือ ML ใด ๆ
การใช้งาน :
!8ball Will I get an A on my exam?
!whattimeดึงและแสดงเวลาปัจจุบันในเมืองที่ระบุ
การใช้งาน :
!whattime New York
โครงการนี้ได้รับใบอนุญาตภายใต้ใบอนุญาต MIT
ลิขสิทธิ์ใบอนุญาต MIT (c) 2024 Sneezeparty
ได้รับอนุญาตโดยไม่ต้องเสียค่าใช้จ่ายสำหรับบุคคลใด ๆ ที่ได้รับสำเนาซอฟต์แวร์นี้และไฟล์เอกสารที่เกี่ยวข้อง ("ซอฟต์แวร์") เพื่อจัดการในซอฟต์แวร์โดยไม่มีข้อ จำกัด รวมถึง แต่ไม่ จำกัด เฉพาะสิทธิ์ในการใช้สำเนาดัดแปลงผสานเผยแพร่เผยแพร่ รวมอยู่ในสำเนาทั้งหมดหรือส่วนสำคัญของซอฟต์แวร์
ซอฟต์แวร์มีให้ "ตามสภาพ" โดยไม่มีการรับประกันใด ๆ ไม่ว่าโดยชัดแจ้งหรือโดยนัยรวมถึง แต่ไม่ จำกัด เฉพาะการรับประกันความสามารถในการค้าการออกกำลังกายสำหรับวัตถุประสงค์เฉพาะและการไม่เข้าร่วม ไม่ว่าในกรณีใดผู้เขียนหรือผู้ถือลิขสิทธิ์จะต้องรับผิดชอบต่อการเรียกร้องความเสียหายหรือความรับผิดอื่น ๆ ไม่ว่าจะเป็นการกระทำของสัญญาการละเมิดหรืออื่น ๆ ที่เกิดขึ้นจากหรือเกี่ยวข้องกับซอฟต์แวร์หรือการใช้งานหรือการติดต่ออื่น ๆ ในซอฟต์แวร์
หากคุณพบปัญหาใด ๆ หรือมีคำถามอย่าลังเลที่จะเปิดปัญหาในส่วนปัญหา GitHub ของที่เก็บ
ซื้อกาแฟเพื่อช่วยสนับสนุนโครงการนี้