Доработка: 1. В vectorstore.py заменить импорт Ollama на from langchain
This commit is contained in:
+2
-3
@@ -2,13 +2,12 @@ import os
|
||||
from pathlib import Path
|
||||
from typing import List
|
||||
|
||||
from langchain_ollama import OllamaEmbeddings
|
||||
from langchain_ollama import OllamaEmbeddings, OllamaLLM
|
||||
from langchain_chroma import Chroma
|
||||
from langchain_text_splitters import RecursiveCharacterTextSplitter
|
||||
from langchain.docstore.document import Document
|
||||
from langchain_tavily import TavilySearchResults
|
||||
from langchain.agents import Tool, AgentExecutor, initialize_agent
|
||||
from langchain.llms import Ollama
|
||||
from dotenv import load_dotenv
|
||||
|
||||
# Загрузка переменных окружения из .env
|
||||
@@ -103,7 +102,7 @@ def create_agent(vectorstore: Chroma) -> AgentExecutor:
|
||||
)
|
||||
]
|
||||
|
||||
llm = Ollama(model="llama3")
|
||||
llm = OllamaLLM(model="llama3")
|
||||
agent_executor = initialize_agent(
|
||||
tools,
|
||||
llm,
|
||||
|
||||
Reference in New Issue
Block a user