-
-
Notifications
You must be signed in to change notification settings - Fork 270
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #89 from n4ze3m/next
v0.0.32
- Loading branch information
Showing
33 changed files
with
619 additions
and
31 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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,25 @@ | ||
import React from "react"; | ||
|
||
export const YoutubeIcon = React.forwardRef< | ||
SVGSVGElement, | ||
React.SVGProps<SVGSVGElement> | ||
>((props, ref) => { | ||
return ( | ||
<svg | ||
xmlns="http://www.w3.org/2000/svg" | ||
width="24" | ||
height="24" | ||
fill="none" | ||
stroke="currentColor" | ||
strokeLinecap="round" | ||
strokeLinejoin="round" | ||
strokeWidth="2" | ||
viewBox="0 0 24 24" | ||
ref={ref} | ||
{...props} | ||
> | ||
<path d="M2.5 17a24.12 24.12 0 010-10 2 2 0 011.4-1.4 49.56 49.56 0 0116.2 0A2 2 0 0121.5 7a24.12 24.12 0 010 10 2 2 0 01-1.4 1.4 49.55 49.55 0 01-16.2 0A2 2 0 012.5 17"></path> | ||
<path d="M10 15l5-3-5-3z"></path> | ||
</svg> | ||
); | ||
}); |
This file contains 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
This file contains 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
This file contains 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
This file contains 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
export function removeUUID(filename:string) { | ||
return filename.replace(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}-/, ''); | ||
} | ||
export function removeUUID(filename: string) { | ||
return filename.replace(/^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}-/, ""); | ||
} |
This file contains 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
This file contains 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
This file contains 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
This file contains 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,42 @@ | ||
-- New Hybrid Search Query | ||
create or replace function kw_match_documents(query_text text, bot_id text, match_count int) | ||
returns table (id int, content text, metadata jsonb, similarity real) | ||
as $$ | ||
begin | ||
return query execute | ||
format('select bt.id, bt.content, bt.metadata, ts_rank(to_tsvector(bt.content), plainto_tsquery($1)) as similarity | ||
from "BotDocument" AS bt | ||
where to_tsvector(bt.content) @@ plainto_tsquery($1) and bt."botId" = $2::text | ||
order by similarity desc | ||
limit $3') | ||
using query_text, bot_id, match_count; | ||
end; | ||
$$ language plpgsql; | ||
-- New Search Query | ||
CREATE OR REPLACE FUNCTION similarity_search_v2 ( | ||
query_embedding vector, | ||
botId text, | ||
match_count int DEFAULT null | ||
) RETURNS TABLE ( | ||
id int, | ||
content text, | ||
metadata jsonb, | ||
similarity float | ||
) | ||
LANGUAGE plpgsql | ||
AS $$ | ||
BEGIN | ||
RETURN QUERY | ||
SELECT | ||
bt.id, | ||
bt.content, | ||
bt.metadata, | ||
1 - (bt.embedding <=> query_embedding) AS similarity | ||
FROM "BotDocument" AS bt | ||
WHERE bt."botId" = similarity_search_v2.botId -- Check botId | ||
ORDER BY bt.embedding <=> query_embedding | ||
LIMIT match_count; | ||
END; | ||
$$; | ||
-- AlterTable | ||
ALTER TABLE "Bot" ADD COLUMN "use_hybrid_search" BOOLEAN NOT NULL DEFAULT false; |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.