Skip to content

Commit

Permalink
updated embeddings to openai
Browse files Browse the repository at this point in the history
  • Loading branch information
Amruth-Vamshi committed Nov 7, 2023
1 parent 1a74632 commit 1da591f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- This is an empty migration.
ALTER TABLE "prompt_history"
DROP COLUMN "embedding",
ADD COLUMN "embedding" vector(1536);

ALTER TABLE "document"
DROP COLUMN "contentEmbedding",
ADD COLUMN "contentEmbedding" vector(1536),
DROP COLUMN "headingEmbedding",
ADD COLUMN "headingEmbedding" vector(1536),
DROP COLUMN "summaryEmbedding",
ADD COLUMN "summaryEmbedding" vector(1536);
4 changes: 2 additions & 2 deletions src/modules/aiTools/ai-tools.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ export class AiToolsService {
let embeddings;
try {
embeddings = await fetch(
`${this.configService.get("AI_TOOLS_BASE_URL")}/embeddings/instructor/local/`,
`${this.configService.get("AI_TOOLS_BASE_URL")}/embeddings/openai/remote/`,
requestOptions
)
embeddings = await embeddings.json()
Expand Down Expand Up @@ -241,7 +241,7 @@ export class AiToolsService {
formdata.append('file', fs.createReadStream(csvFilePath), 'data.csv');
try{
const response = await axios.post(
`${this.configService.get("AI_TOOLS_BASE_URL")}/embeddings/instructor/local/`,
`${this.configService.get("AI_TOOLS_BASE_URL")}/embeddings/openai/remote/`,
formdata, {
headers: formdata.getHeaders(),
});
Expand Down

0 comments on commit 1da591f

Please sign in to comment.