Skip to content

Commit

Permalink
rename eng option rag to embedding
Browse files Browse the repository at this point in the history
Signed-off-by: cbh778899 <cbh778899@outlook.com>
  • Loading branch information
cbh778899 committed Aug 4, 2024
1 parent b598506 commit 643ffef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion database/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ export async function searchByEmbedding(vector) {
export async function searchByMessage(msg) {
const { embedding } = await post('embedding', {body: {
content: msg
}}, { eng: "rag" });
}}, { eng: "embedding" });
return await searchByEmbedding(embedding);
}
4 changes: 2 additions & 2 deletions tools/request.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

const BASE_URL = {
"chat": `http://${process.env.INFERENCE_ENG || 'llamacpp'}:${process.env.ENG_ACCESS_PORT || 8080}`,
"rag": `http://${process.env.EMBEDDING_ENG || 'embedding_eng'}:${process.env.ENG_ACCESS_PORT || 8080}`
"embedding": `http://${process.env.EMBEDDING_ENG || 'embedding_eng'}:${process.env.ENG_ACCESS_PORT || 8080}`
}

const default_options = {
Expand All @@ -26,7 +26,7 @@ const default_options = {

/**
* @typedef RequestOptions
* @property {"rag"|"chat"} eng select between rag engine or chat engine, default value is `chat`
* @property {"embedding"|"chat"} eng select between embedding engine or chat engine, default value is `chat`
* @property {Boolean} getJSON
* * If set to `true`, this function will return the result of `await(await fetch(...)).json();`
* and include an attribute `http_error: true` if there's any http error occurs during fetch().
Expand Down

0 comments on commit 643ffef

Please sign in to comment.