kotaemon/knowledgehub/embeddings/openai.py
Tuan Anh Nguyen Dang (Tadashi_Cin) 79cc60e6a2 [AUR-429] Add MVP pipeline with Ingestion and QA stage (#39)
* add base Tool

* minor update test_tool

* update test dependency

* update test dependency

* Fix namespace conflict

* update test

* add base Agent Interface, add ReWoo Agent

* minor update

* update test

* fix typo

* remove unneeded print

* update rewoo agent

* add LLMTool

* update BaseAgent type

* add ReAct agent

* add ReAct agent

* minor update

* minor update

* minor update

* minor update

* update base reader with BaseComponent

* add splitter

* update agent and tool

* update vectorstores

* update load/save for indexing and retrieving pipeline

* update test_agent for more use-cases

* add missing dependency for test

* update test case for in memory vectorstore

* add TextSplitter to BaseComponent

* update type hint basetool

* add insurance mvp pipeline

* update requirements

* Remove redundant plugins param

* Mock GoogleSearch

---------

Co-authored-by: trducng <trungduc1992@gmail.com>
2023-10-05 12:31:33 +07:00

32 lines
960 B
Python

from langchain.embeddings import OpenAIEmbeddings as LCOpenAIEmbeddings
from .base import LangchainEmbeddings
class OpenAIEmbeddings(LangchainEmbeddings):
"""OpenAI embeddings.
This method is wrapped around the Langchain OpenAIEmbeddings class.
"""
_lc_class = LCOpenAIEmbeddings
class AzureOpenAIEmbeddings(LangchainEmbeddings):
"""Azure OpenAI embeddings.
This method is wrapped around the Langchain OpenAIEmbeddings class.
"""
_lc_class = LCOpenAIEmbeddings
def __init__(self, **params):
params["openai_api_type"] = "azure"
# openai.error.InvalidRequestError: Too many inputs. The max number of
# inputs is 16. We hope to increase the number of inputs per request
# soon. Please contact us through an Azure support request at:
# https://go.microsoft.com/fwlink/?linkid=2213926 for further questions.
params["chunk_size"] = 16
super().__init__(**params)