- 
                Notifications
    You must be signed in to change notification settings 
- Fork 315
feat: clone rag config #654
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Merged
      
      
            leonardmq
  merged 11 commits into
  main
from
leonard/kil-35-clone-option-for-search-tools
  
      
      
   
  Oct 15, 2025 
      
    
  
     Merged
                    Changes from 10 commits
      Commits
    
    
            Show all changes
          
          
            11 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      90dccc6
              
                fix: error handling and validation in embedding form
              
              
                leonardmq 3d48e56
              
                refactor: break down create rag config page into smaller components
              
              
                leonardmq 980291d
              
                feat: add rag config cloning
              
              
                leonardmq 8d61f21
              
                refactor: better loading and error management in embedding form
              
              
                leonardmq 7516f7f
              
                cr feedback
              
              
                leonardmq 0cd1c65
              
                refactor: initial name should be Copy Of XXX and not the original name
              
              
                leonardmq 74d5525
              
                fix: coderabbit feedback
              
              
                leonardmq 7164d33
              
                Merge branch 'main' of github.com:Kiln-AI/Kiln into leonard/kil-35-cl…
              
              
                leonardmq ad3325c
              
                Merge branch 'main' of github.com:Kiln-AI/Kiln into leonard/kil-35-cl…
              
              
                leonardmq 1bbe071
              
                fix: chunker options formatting got broken during conflict resolution
              
              
                leonardmq d3ac25a
              
                fix: formatter on rag config table overview
              
              
                leonardmq File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
          Some comments aren't visible on the classic Files Changed page.
        
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
        
          
          
            92 changes: 92 additions & 0 deletions
          
          92 
        
  .../routes/(app)/docs/rag_configs/[project_id]/[rag_config_id]/rag_config/clone/+page.svelte
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| <script lang="ts"> | ||
| import { page } from "$app/stores" | ||
| import AppPage from "../../../../../../app_page.svelte" | ||
| import { goto } from "$app/navigation" | ||
| import { client } from "$lib/api_client" | ||
| import { createKilnError, KilnError } from "$lib/utils/error_handlers" | ||
| import type { RagConfigWithSubConfigs } from "$lib/types" | ||
| import { onMount } from "svelte" | ||
| import EditRagConfigForm from "../../../create_rag_config/edit_rag_config_form.svelte" | ||
|  | ||
| $: project_id = $page.params.project_id | ||
| $: rag_config_id = $page.params.rag_config_id | ||
|  | ||
| let loading: boolean = true | ||
| let error: KilnError | null = null | ||
| let rag_config: RagConfigWithSubConfigs | null = null | ||
|  | ||
| onMount(async () => { | ||
| await get_rag_config() | ||
| }) | ||
|  | ||
| async function get_rag_config() { | ||
| try { | ||
| loading = true | ||
| const { data: rag_config_data, error: get_rag_config_error } = | ||
| await client.GET( | ||
| "/api/projects/{project_id}/rag_configs/{rag_config_id}", | ||
| { | ||
| params: { | ||
| path: { | ||
| project_id, | ||
| rag_config_id, | ||
| }, | ||
| }, | ||
| }, | ||
| ) | ||
|  | ||
| if (get_rag_config_error) { | ||
| throw get_rag_config_error | ||
| } | ||
|  | ||
| rag_config = rag_config_data | ||
| } catch (e) { | ||
| error = createKilnError(e) | ||
| } finally { | ||
| loading = false | ||
| } | ||
| } | ||
| </script> | ||
|  | ||
| <div class="max-w-[900px]"> | ||
| <AppPage | ||
| title="Clone Search Tool (RAG)" | ||
| subtitle="This creates a new search tool, based on the configuration of the existing tool." | ||
| sub_subtitle="Read the Docs" | ||
| sub_subtitle_link="https://docs.kiln.tech/docs/documents-and-search-rag#building-a-search-tool" | ||
| breadcrumbs={[ | ||
| { | ||
| label: "Docs & Search", | ||
| href: `/docs/${project_id}`, | ||
| }, | ||
| { | ||
| label: "Search Tools", | ||
| href: `/docs/rag_configs/${project_id}`, | ||
| }, | ||
| ]} | ||
| > | ||
| {#if loading} | ||
| <div class="w-full min-h-[50vh] flex justify-center items-center"> | ||
| <div class="loading loading-spinner loading-lg"></div> | ||
| </div> | ||
| {:else if error} | ||
| <div class="w-full min-h-[50vh] flex justify-center items-center"> | ||
| <div class="text-red-500">{error.message}</div> | ||
| </div> | ||
| {:else if !rag_config} | ||
| <div class="w-full min-h-[50vh] flex justify-center items-center"> | ||
| <div class="text-red-500">Search Tool not found</div> | ||
| </div> | ||
| {:else} | ||
| <EditRagConfigForm | ||
| initial_rag_config={{ | ||
| ...rag_config, | ||
| name: `Copy of ${rag_config.name}`, | ||
| }} | ||
| on:success={() => { | ||
| goto(`/docs/rag_configs/${project_id}`) | ||
| }} | ||
| /> | ||
| {/if} | ||
| </AppPage> | ||
| </div> | ||
        
          
          
            1 change: 1 addition & 0 deletions
          
          1 
        
  .../src/routes/(app)/docs/rag_configs/[project_id]/[rag_config_id]/rag_config/clone/+page.ts
  
  
      
      
   
        
      
      
    
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1 @@ | ||
| export const prerender = false | 
      
      Oops, something went wrong.
        
    
  
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Uh oh!
There was an error while loading. Please reload this page.