Logo
Explore Help
Sign In
discourse/discourse-ai
1
0
Fork 0
You've already forked discourse-ai
mirror of https://github.com/discourse/discourse-ai.git synced 2025-07-01 12:02:16 +00:00
Code Issues Packages Projects Releases Wiki Activity
discourse-ai/spec/fabricators/rag_document_fragment_fabricator.rb

8 lines
213 B
Ruby
Raw Normal View History

FEATURE: AI Bot RAG support. (#537) This PR lets you associate uploads to an AI persona, which we'll split and generate embeddings from. When building the system prompt to get a bot reply, we'll do a similarity search followed by a re-ranking (if available). This will let us find the most relevant fragments from the body of knowledge you associated with the persona, resulting in better, more informed responses. For now, we'll only allow plain-text files, but this will change in the future. Commits: * FEATURE: RAG embeddings for the AI Bot This first commit introduces a UI where admins can upload text files, which we'll store, split into fragments, and generate embeddings of. In a next commit, we'll use those to give the bot additional information during conversations. * Basic asymmetric similarity search to provide guidance in system prompt * Fix tests and lint * Apply reranker to fragments * Uploads filter, css adjustments and file validations * Add placeholder for rag fragments * Update annotations
2024-04-01 13:43:34 -03:00
# frozen_string_literal: true
Fabricator(:rag_document_fragment) do
fragment { sequence(:fragment) { |n| "Document fragment #{n}" } }
upload
fragment_number { sequence(:fragment_number) { |n| n + 1 } }
end
Reference in New Issue Copy Permalink
Powered by Gitea Version: 1.23.8 Page: 86ms Template: 3ms
English
Bahasa Indonesia Deutsch English Español Français Gaeilge Italiano Latviešu Magyar nyelv Nederlands Polski Português de Portugal Português do Brasil Suomi Svenska Türkçe Čeština Ελληνικά Български Русский Українська فارسی മലയാളം 日本語 简体中文 繁體中文(台灣) 繁體中文(香港) 한국어
Licenses API