Skip to content

Commit

Permalink
Explicit model (langchain-ai#223)
Browse files Browse the repository at this point in the history
  • Loading branch information
hinthornw authored Dec 7, 2023
1 parent e6231f5 commit e3329c2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ def load_langchain_docs():
meta_function=metadata_extractor,
).load()


def load_langsmith_docs():
return RecursiveUrlLoader(
url="https://docs.smith.langchain.com/",
Expand Down Expand Up @@ -97,7 +98,7 @@ def load_api_docs():

def get_embeddings_model() -> Embeddings:
if os.environ.get("VOYAGE_AI_URL") and os.environ.get("VOYAGE_AI_MODEL"):
return VoyageEmbeddings()
return VoyageEmbeddings(model=os.environ["VOYAGE_AI_MODEL"])
return OpenAIEmbeddings(chunk_size=200)


Expand Down
4 changes: 3 additions & 1 deletion main.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,9 @@ def create_chain(
)


add_routes(app, answer_chain, path="/chat", input_type=ChatRequest, config_keys=["metadata"])
add_routes(
app, answer_chain, path="/chat", input_type=ChatRequest, config_keys=["metadata"]
)


class SendFeedbackBody(BaseModel):
Expand Down

0 comments on commit e3329c2

Please sign in to comment.