Skip to content

Commit

Permalink
RAG Test works now...
Browse files Browse the repository at this point in the history
  • Loading branch information
rmusser01 committed Nov 1, 2024
1 parent beddab0 commit 6b891bf
Show file tree
Hide file tree
Showing 4 changed files with 235 additions and 456 deletions.
17 changes: 9 additions & 8 deletions App_Function_Libraries/RAG/RAG_Library_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,15 @@
# Read the configuration file
config.read('config.txt')


search_functions = {
"Media DB": search_media_db,
"RAG Chat": search_rag_chat,
"RAG Notes": search_rag_notes,
"Character Chat": search_character_chat,
"Character Cards": search_character_cards
}

# RAG pipeline function for web scraping
# def rag_web_scraping_pipeline(url: str, query: str, api_choice=None) -> Dict[str, Any]:
# try:
Expand Down Expand Up @@ -483,14 +492,6 @@ def perform_full_text_search(query: str, database_type: str, relevant_ids: List[
fts_top_k = 10

# Call appropriate search function based on database type
search_functions = {
"Media DB": search_media_db,
"RAG Chat": search_rag_chat,
"RAG Notes": search_rag_notes,
"Character Chat": search_character_chat,
"Character Cards": search_character_cards
}

if database_type not in search_functions:
raise ValueError(f"Unsupported database type: {database_type}")

Expand Down
7 changes: 6 additions & 1 deletion Config_Files/Backup_Config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mistral_model = mistral-large-latest
mistral_api_key = <mistral_api_key>>
custom_openai_api_key = <key_here>
custom_openai_api_ip = <api_ip_here>
default_api = openai

[Local-API]
kobold_api_IP = http://127.0.0.1:5001/api/v1/generate
Expand Down Expand Up @@ -44,6 +45,10 @@ words_per_second = 3
save_character_chats = False
save_rag_chats = False

[Auto-Save]
save_character_chats = False
save_rag_chats = False

[Prompts]
prompt_sample = "What is the meaning of life?"
video_summarize_prompt = "Above is the transcript of a video. Please read through the transcript carefully. Identify the main topics that are discussed over the course of the transcript. Then, summarize the key points about each main topic in bullet points. The bullet points should cover the key information conveyed about each topic in the video, but should be much shorter than the full transcript. Please output your bullet point summary inside <bulletpoints> tags. Do not repeat yourself while writing the summary."
Expand All @@ -58,7 +63,7 @@ elasticsearch_port = 9200
# Additionally you can use elasticsearch as the database type, just replace `sqlite` with `elasticsearch` for `type` and provide the `elasticsearch_host` and `elasticsearch_port` of your configured ES instance.
chroma_db_path = Databases/chroma_db
prompts_db_path = Databases/prompts.db
rag_qa_db_path = Databases/rag_qa.db
rag_qa_db_path = Databases/RAG_QA_Chat.db
character_db_path = Databases/chatDB.db

[Embeddings]
Expand Down
9 changes: 8 additions & 1 deletion Config_Files/config.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ mistral_model = mistral-large-latest
mistral_api_key = <mistral_api_key>>
custom_openai_api_key = <key_here>
custom_openai_api_ip = <api_ip_here>
default_api = openai

[Local-API]
kobold_api_IP = http://127.0.0.1:5001/api/v1/generate
Expand All @@ -42,6 +43,11 @@ processing_choice = cuda
chunk_duration = 30
words_per_second = 3

[Auto-Save]
save_character_chats = False
save_rag_chats = False


[Prompts]
prompt_sample = "What is the meaning of life?"
video_summarize_prompt = "Above is the transcript of a video. Please read through the transcript carefully. Identify the main topics that are discussed over the course of the transcript. Then, summarize the key points about each main topic in bullet points. The bullet points should cover the key information conveyed about each topic in the video, but should be much shorter than the full transcript. Please output your bullet point summary inside <bulletpoints> tags. Do not repeat yourself while writing the summary."
Expand All @@ -56,7 +62,8 @@ elasticsearch_port = 9200
# Additionally you can use elasticsearch as the database type, just replace `sqlite` with `elasticsearch` for `type` and provide the `elasticsearch_host` and `elasticsearch_port` of your configured ES instance.
chroma_db_path = Databases/chroma_db
prompts_db_path = Databases/prompts.db
rag_qa_db_path = Databases/rag_qa.db
rag_qa_db_path = Databases/RAG_QA_Chat.db
character_db_path = Databases/chatDB.db

[Embeddings]
embedding_provider = openai
Expand Down
Loading

0 comments on commit 6b891bf

Please sign in to comment.