-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'update' of github.com:mfmezger/conversational-agent-lan…
…gchain into update
- Loading branch information
Showing
10 changed files
with
169 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
"""Cohere Backend.""" | ||
from dotenv import load_dotenv | ||
|
||
from agent.backend.LLMBase import LLMBackend, LLMBase | ||
from agent.data_model.request_data_model import ( | ||
Filtering, | ||
RAGRequest, | ||
SearchRequest, | ||
) | ||
|
||
load_dotenv() | ||
|
||
|
||
class CohereService(LLMBase): | ||
|
||
"""Wrapper for cohere llms.""" | ||
|
||
def embed_documents(self, directory: str, llm_backend: LLMBackend) -> None: | ||
"""Embedd new docments in the Qdrant DB.""" | ||
|
||
def create_collection(self, name: str) -> bool: | ||
"""Create a new collection in the Vector Database.""" | ||
|
||
def search(self, search: SearchRequest, filtering: Filtering) -> list: | ||
"""Searches the documents in the Qdrant DB with semantic search.""" | ||
|
||
def generate(self, prompt: str) -> str: | ||
"""Generate text from a prompt.""" | ||
|
||
def rag(self, rag: RAGRequest, search: SearchRequest, filtering: Filtering) -> tuple: | ||
"""Retrieval Augmented Generation.""" | ||
|
||
def summarize_text(self, text: str) -> str: | ||
"""Summarize text.""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.