Skip to content
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

Search with Context Similarity #2

Merged
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
3de383f
chore(deps): openAi
Keyrxng Jul 12, 2024
bf8d492
chore: settings config
Keyrxng Jul 12, 2024
d8de447
chore: remove supabase
Keyrxng Jul 12, 2024
12cbcc4
feat: add commnt with diff styles
Keyrxng Jul 12, 2024
b9c1ab5
feat: simple openai chat fn
Keyrxng Jul 12, 2024
7643b3f
feat: issue related functions
Keyrxng Jul 12, 2024
bfac23d
fix: improved context issue filtering
Keyrxng Jul 12, 2024
554f3f8
chore: types and plugin entry
Keyrxng Jul 13, 2024
55d5b2a
feat: issue utils
Keyrxng Jul 13, 2024
bd790b5
feat: chat ready
Keyrxng Jul 13, 2024
6063f36
fix: cspell, eslint
Keyrxng Jul 13, 2024
1d51869
feat: ubiquibot-logger
Keyrxng Jul 13, 2024
6b0333b
fix: ignore all bot comments
Keyrxng Jul 13, 2024
a72c97b
chore: use string arrays, remove never configs
Keyrxng Jul 13, 2024
c7b6605
feat: deeper linked context fetching
Keyrxng Jul 13, 2024
94d65e5
chore: types and eslint ignore .wrangler
Keyrxng Jul 14, 2024
154a9b2
chore: simplify main handler
Keyrxng Jul 14, 2024
2b86ab2
feat: comments handler
Keyrxng Jul 14, 2024
7e6582b
chore: improved context handling
Keyrxng Jul 14, 2024
8a0a796
chore: refactor chat formatting, remove no diff error log
Keyrxng Jul 14, 2024
834a570
refactor: optimizing
Keyrxng Jul 14, 2024
c684530
chore: remove env and init tests
Keyrxng Jul 23, 2024
c08b9d0
chore: test env setup
Keyrxng Jul 23, 2024
93e9cd4
refactor: handle PluginInputs separately for better tests
Keyrxng Jul 23, 2024
042bcc0
chore: setup tests
Keyrxng Jul 23, 2024
6ce964d
chore: chat history and linked context tests
Keyrxng Jul 23, 2024
64bf785
chore: remove depth
Keyrxng Jul 23, 2024
f724b85
chore: diff comments from logs
Keyrxng Jul 23, 2024
053856e
chore: fix test
Keyrxng Jul 23, 2024
7bd0557
ci: knip
Keyrxng Jul 23, 2024
442dacb
chore: update .lock file
Keyrxng Jul 23, 2024
9f39f24
chore: fix key
Keyrxng Jul 23, 2024
8b682c8
chore: code cleanup
Keyrxng Jul 23, 2024
230abe0
chore: add another bot comment filter
Keyrxng Jul 23, 2024
f9a8aa4
chore(deps): types/jest for namespace
Keyrxng Jul 24, 2024
1fd9414
chore: eslint style and optimizing handlers
Keyrxng Jul 24, 2024
1160999
chore: unused ternary
Keyrxng Jul 24, 2024
4771e02
chore: system msg format fix
Keyrxng Jul 24, 2024
d9d440a
feat: ubiquity_os_app_slug config item
Keyrxng Sep 24, 2024
0834e09
chore: move api key into env, remove isEnabled, add manifest
Keyrxng Sep 24, 2024
de5a65c
chore: remove workflow items, correct test imports, update logger
Keyrxng Sep 24, 2024
b547300
chore: worker workflows, dotenv, utils > helpers
Keyrxng Sep 25, 2024
96f2a8b
chore: throw LogReturn and bubble up error comment
Keyrxng Sep 25, 2024
68e7938
chore: use regex for slug capture
Keyrxng Sep 25, 2024
d7ceafa
chore: refactor env var name and tests
Keyrxng Sep 25, 2024
3ca8740
chore: format
Keyrxng Sep 25, 2024
742678a
chore: slight fetch and handling improvements
Keyrxng Sep 25, 2024
1701446
chore: more robust key creation, minor fixes
Keyrxng Sep 25, 2024
c687b8b
chore: format and add hashMatch from body
Keyrxng Sep 25, 2024
7d2cc57
chore: optional chaining, try catch blocks
Keyrxng Sep 25, 2024
c498500
chore: add token usage in html comment
Keyrxng Sep 25, 2024
ef080c9
chore: typo
Keyrxng Sep 25, 2024
c4e98b6
chore: readme
Keyrxng Sep 26, 2024
48faffb
chore: camelCase and add config test
Keyrxng Sep 26, 2024
5076ec8
chore: hardcode bot name
Keyrxng Sep 26, 2024
d8bd296
chore: remove t.optional and add baseUrl check
Keyrxng Sep 26, 2024
283d6c7
chore: fix typo
Keyrxng Sep 26, 2024
6b05fdb
chore: optional endpoint, remove packageManager
Keyrxng Sep 30, 2024
a1e47df
Merge pull request #1 from ubq-testing/development
sshivaditya2019 Oct 3, 2024
e133616
fix: project setup and supabase setup
sshivaditya Oct 5, 2024
51454d4
fix: tests
sshivaditya Oct 5, 2024
0f82015
feat: basic chat rag works
sshivaditya Oct 6, 2024
fa67948
fix: cspell
sshivaditya Oct 6, 2024
d1b4514
fix: ci passing locally and cleanup
sshivaditya Oct 12, 2024
dd4c334
fix: tests
sshivaditya Oct 12, 2024
e37f585
fix: tests and knip
sshivaditya Oct 12, 2024
a55fb00
Update package.json
0x4007 Oct 16, 2024
0f00dd4
fix: type rename and add tsx
sshivaditya Oct 17, 2024
6c7f136
fix: knip
sshivaditya Oct 17, 2024
9583286
feat: added instruction to the embedding
sshivaditya Oct 17, 2024
baec08a
fix: tests
sshivaditya Oct 17, 2024
1edbd21
fix: inverted the scale on similarity threshold
sshivaditya Oct 17, 2024
b417cd5
fix: removed jest commas
sshivaditya Oct 17, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 1 addition & 13 deletions src/handlers/ask-llm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export async function askQuestion(context: Context, question: string) {
repo: context.payload.repository.name,
});
const formattedChat = await formatChatHistory(context, streamlinedComments, specAndBodies);
context.logger.info(`${formattedChat}`);
return await askGpt(context, question, formattedChat);
}

Expand Down Expand Up @@ -61,7 +62,6 @@ export async function askGpt(context: Context, question: string, formattedChat:
// const reRankedChat = formattedChat.length > 0 ? await context.adapters.voyage.reranker.reRankResults(formattedChat.filter(text => text !== ""), question, 300) : [];
similarText = similarText.filter((text) => text !== "");
const rerankedText = similarText.length > 0 ? await context.adapters.voyage.reranker.reRankResults(similarText, question) : [];
rerankedText.forEach((text) => removeUnwantedChars(text));
return context.adapters.openai.completions.createCompletion(
question,
model,
Expand All @@ -71,15 +71,3 @@ export async function askGpt(context: Context, question: string, formattedChat:
UBIQUITY_OS_APP_NAME
);
}

/**
* Removes unwanted characters from the text like emojis, special characters etc.
* @param text
* @returns
*/
function removeUnwantedChars(text: string): string {
if (!text) {
return "";
}
return text.replace(/[^a-zA-Z0-9\s]/g, "");
}
4 changes: 2 additions & 2 deletions tests/main.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ describe("Ask plugin tests", () => {
2 ubiquity: ${TEST_QUESTION} [#1](https://www.github.com/ubiquity/test-repo/issues/1)
=== End Current Issue #1 Conversation ===

=== Linked Issue #2 Specification === ubiquity/test-repo/2 ===
,=== Linked Issue #2 Specification === ubiquity/test-repo/2 ===
0x4007 marked this conversation as resolved.
Show resolved Hide resolved

Related to issue #3
=== End Linked Issue #2 Specification ===
Expand All @@ -155,7 +155,7 @@ describe("Ask plugin tests", () => {
3 ubiquity: ${ISSUE_ID_3_CONTENT} [#3](https://www.github.com/ubiquity/test-repo/issues/3)
=== End Linked Issue #2 Conversation ===

=== Linked Issue #3 Specification === ubiquity/test-repo/3 ===
,=== Linked Issue #3 Specification === ubiquity/test-repo/3 ===

Just another issue
=== End Linked Issue #3 Specification ===
Expand Down