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

약 정보 DB 구축 #2

Closed
guesung opened this issue May 25, 2023 · 5 comments · Fixed by #11
Closed

약 정보 DB 구축 #2

guesung opened this issue May 25, 2023 · 5 comments · Fixed by #11
Assignees
Labels
enhancement New feature or request

Comments

@guesung
Copy link
Owner

guesung commented May 25, 2023

LLM -> 약 정보 DB에서만 데이터를 검색하여 오류 없는 데이터 전달할 수 있도록

@guesung guesung self-assigned this May 25, 2023
@guesung guesung added this to the 약 정보 검색 milestone May 25, 2023
@guesung guesung added the enhancement New feature or request label May 25, 2023
@guesung
Copy link
Owner Author

guesung commented May 25, 2023

Conversational Reterival QA 메소드 사용하면 될 듯함 : 유저가 대화한 내용을 바탕으로 converstation 가능

@guesung
Copy link
Owner Author

guesung commented May 26, 2023

MemoryVectorStore메소드 : 선형 검색 지원
예시

import { MemoryVectorStore } from "langchain/vectorstores/memory";
import { OpenAIEmbeddings } from "langchain/embeddings/openai";

export const run = async () => {
  const vectorStore = await MemoryVectorStore.fromTexts(
    ["Hello world", "Bye bye", "hello nice world"],
    [{ id: 2 }, { id: 1 }, { id: 3 }],
    new OpenAIEmbeddings()
  );

  const resultOne = await vectorStore.similaritySearch("hello world", 1);
  console.log(resultOne);
};

위 코드 처럼 존재하는 Text에서 데이터 불러와 겁색 가능

@guesung
Copy link
Owner Author

guesung commented May 26, 2023

MemoryVectorStorefromDocuments() 메소드 사용
=> 매개변수 docs와 embeddings 필요
docs : CSV파일
embeddings : new OpenAIEmbeddings()

@guesung
Copy link
Owner Author

guesung commented May 26, 2023

CSVLoader을 사용하니 아래와 같은 오류 발생
스크린샷 2023-05-26 오후 3 48 51

@guesung
Copy link
Owner Author

guesung commented May 26, 2023

파일을 읽고 써야 하는 'fs'는 브라우저에서 작동이 안된다. node와 같은 백단에서만 사용이 가능하다. 그렇다면 어떻게 해야할까 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant