-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Taranjeet Singh <[email protected]>
- Loading branch information
Showing
7 changed files
with
347 additions
and
166 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,33 +1,38 @@ | ||
import logging | ||
from typing import Optional | ||
|
||
from embedchain.apps.custom_app import CustomApp | ||
from embedchain.apps.app import App | ||
from embedchain.config import CustomAppConfig | ||
from embedchain.embedder.openai import OpenAIEmbedder | ||
from embedchain.helper.json_serializable import register_deserializable | ||
from embedchain.llm.llama2 import Llama2Llm | ||
from embedchain.vectordb.chroma import ChromaDB | ||
|
||
|
||
@register_deserializable | ||
class Llama2App(CustomApp): | ||
class Llama2App(App): | ||
""" | ||
The EmbedChain Llama2App class. | ||
Methods: | ||
add(source, data_type): adds the data from the given URL to the vector db. | ||
query(query): finds answer to the given query using vector database and LLM. | ||
chat(query): finds answer to the given query using vector database and LLM, with conversation history. | ||
.. deprecated:: 0.0.59 | ||
Use `App` instead. | ||
""" | ||
|
||
def __init__(self, config: CustomAppConfig = None, system_prompt: Optional[str] = None): | ||
""" | ||
.. deprecated:: 0.0.59 | ||
Use `App` instead. | ||
:param config: CustomAppConfig instance to load as configuration. Optional. | ||
:param system_prompt: System prompt string. Optional. | ||
""" | ||
|
||
if config is None: | ||
config = CustomAppConfig() | ||
|
||
super().__init__( | ||
config=config, llm=Llama2Llm(), db=ChromaDB(), embedder=OpenAIEmbedder(), system_prompt=system_prompt | ||
logging.warning( | ||
"DEPRECATION WARNING: Please use `App` instead of `Llama2App`. " | ||
"`Llama2App` will be removed in a future release. " | ||
"Please refer to https://docs.embedchain.ai/advanced/app_types#llama2app for instructions." | ||
) | ||
|
||
super().__init__(config=config, llm=Llama2Llm(), system_prompt=system_prompt) |
Oops, something went wrong.