Commit Graph

947 Commits

Author SHA1 Message Date
lujingxuan 135207caa3 fix initialize 2024-01-02 15:02:31 +08:00
lujingxuan d7ed9806ca Merge remote-tracking branch 'origin/main' into feat_add_openai_function_agent 2023-12-30 23:39:12 +08:00
lujingxuan 4287e72129 format agent_scratchpad and error 2023-12-30 23:38:11 +08:00
Eli Bendersky f89cec5ef9 Remove unused schema types (#473) 2023-12-30 06:27:44 -08:00
Eli Bendersky 791e680123 Remove duplicated and unused LLMResult type from schema (#472)
It exists in the llms package already
2023-12-30 06:22:35 -08:00
Daniel Bos 536f16c12a textsplitter: handle singular markdown tokens in markdown_splitter (#467)
The markdown splitter was not correctly handling singular markdown tokens
like Hr or Fence. These tokens do not have a corresponding close type,
which was causing issues in the indexOfCloseTag function.

To fix this, a check has been added to return the start index if the
closeType is nil, indicating a singular token. This prevents the function
from incorrectly trying to find a close tag for these tokens and running
past the end of the document.
2023-12-30 03:57:23 -08:00
Travis Cline eeadc49c70 agents: fixup comment 2023-12-29 13:28:17 -08:00
Thomas 2e81b2bdbd vectorstores: Add azureaisearch (#462)
* add azure ai search as vectorstore
2023-12-29 21:25:24 +00:00
Eli Bendersky 85e33db166 Run go.mod tidy to make IDE happy (#470) 2023-12-29 13:15:43 -08:00
Thomas fc11926d0c vectorstores: Add opensearch (#464)
* vectorstores: Add opensearch

---------

Co-authored-by: Jay Lalakiya <63226109+jaylalakiya@users.noreply.github.com>
Co-authored-by: Travis Cline <travis.cline@gmail.com>
2023-12-29 12:17:17 -08:00
Travis Cline 130eec9f4a Merge pull request #469 from tmc/fixup-jinja2
templates: Fix up gonja/jinja2 handling
2023-12-29 12:14:28 -08:00
Travis Cline 214f551be8 templates: Fix up gonja/jinja2 handling 2023-12-29 12:11:13 -08:00
Travis Cline 1c7cb8de41 Merge pull request #468 from tmc/langmodel
Refactor LanguageModel interface away
2023-12-29 11:16:30 -08:00
Eli Bendersky 435467ab33 Resolve lint complaints and gofumpt 2023-12-29 09:56:26 -08:00
Eli Bendersky 2ed43f054f Remove GeneratePrompt methods as they're no longer needed 2023-12-29 09:50:06 -08:00
Eli Bendersky ab14227446 Remove mentions of the LanguageModel interface 2023-12-29 09:44:57 -08:00
Eli Bendersky 93cea28bfe Refactor usage of LanguageModel out
Replace it by LLM and adjust code and tests accordingly

re #465
2023-12-29 09:35:52 -08:00
Eli Bendersky eb58836512 Skip tests that are currently failing (#415) (#466) 2023-12-28 21:02:13 -08:00
Travis Cline 693bd1eb59 pgvector: return error directly 2023-12-28 17:28:00 -08:00
Jay Lalakiya 5c345a14a7 vectorstores: Add ids to the return when adding documents in any vectorstore (#448)
* Add ids to the return when adding documents in any vectorstore

* fixes lint checks

* examples: Point vectorstore examples to branch

---------

Co-authored-by: Travis Cline <travis.cline@gmail.com>
2023-12-28 17:11:54 -08:00
chyroc 310afd2c66 promps: move prompts to embedded text files (#451) 2023-12-28 16:55:43 -08:00
Travis Cline a39989164e examples: update to v0.1.2 2023-12-28 16:24:36 -08:00
Travis Cline d8b25bd69e examples: Update to pre-release tag v0.1.2 2023-12-28 16:20:04 -08:00
Travis Cline 59f2be62ed callbacks: Add other handlers to CombingHandler v0.1.2-alpha.1 2023-12-28 16:18:21 -08:00
Travis Cline b0fbdd0023 chore: Update go.mod, go.sum v0.1.2-alpha.0 2023-12-28 16:13:48 -08:00
chyroc 923373ff0c Feat: support combine multi callbacks (#446) 2023-12-28 15:26:42 -08:00
Abirdcfly affaa87bdd memory: add ConversationWindowBuffer (#411)
Port the ConversationBufferWindowMemory class from langchain python in langchaingo

Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2023-12-28 15:24:35 -08:00
chyroc 0f24bf1d9f Feat: support render prompt template with jinjia2 (#450) 2023-12-28 15:23:51 -08:00
Abirdcfly 1ee33af9af vectorstores: fix weaviate not return score from SimilaritySearch (#454)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2023-12-28 15:22:51 -08:00
chyroc 534f75725e Feat: callbacks.Handler support handle error (#457)
Feat: support HandleLLMError for llms.LLM
2023-12-28 15:22:05 -08:00
me020523 74527d34b3 add StopReason field in Generation struct. (#458) rm 2023-12-28 15:18:52 -08:00
h3l 284a853cc9 support callback handler to llm chain (#461)
* support callback handler to llm chain

* fix golint

---------

Co-authored-by: lvzhong <lvzhong@bytedance.com>
2023-12-28 15:17:37 -08:00
h3l 580395f9d4 fix: avoid panic when call openai.NewChat() and openai.New() (#460)
avoid panic when opts is nil

Co-authored-by: lvzhong <lvzhong@bytedance.com>
2023-12-28 15:17:05 -08:00
lujingxuan 377594f85a format 2023-12-26 18:04:57 +08:00
lujingxuan 768d4dcd25 format 2023-12-26 18:01:29 +08:00
lujingxuan 644afc41c8 format 2023-12-26 17:55:53 +08:00
lujingxuan fbc4ed6c9e format 2023-12-26 17:54:01 +08:00
lujingxuan 9dd6da65e6 add openai functions agent 2023-12-26 17:29:14 +08:00
chyroc 99bb50d3c7 Feat: use chains callback as streaming func (#447) 2023-12-24 21:05:42 -08:00
Abirdcfly e98eb1703a vectorstores: fix chroma not return score from SimilaritySearch (#449)
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
2023-12-24 18:17:23 -08:00
Jay Lalakiya 351b8b52b1 embeddings: Fix BatchTexts function (#453)
* Fix BatchTexts function in embeddings

* Add test cases for util func added
2023-12-23 13:47:11 -08:00
Travis Cline 213b9dca74 examples: Update langchaingo to v0.1.1 (#445) 2023-12-20 21:40:03 +00:00
Travis Cline 560f27812e deps: Update x/crypto (#444) v0.1.1 2023-12-20 20:04:19 +00:00
chyroc 55f772c21a Docs: fix comment typo (#442)
* Docs: fix comment typo

* docs: a llm -> an LLM

---------

Co-authored-by: Travis Cline <travis.cline@gmail.com>
2023-12-20 19:57:37 +00:00
chyroc 5eb184f48d feat: read OPENAI_API_BASE env to compatible with langchain (#437) 2023-12-20 11:56:25 -08:00
chyroc 4825e45403 feat: use WithCallback to set openai callback option (#438) 2023-12-20 11:56:16 -08:00
chyroc a5e1d6017c fix: remove suffix slash from openai base url (#436) 2023-12-20 11:52:42 -08:00
Mehul Shah dcae4f66a6 pgvector: Fix DropTable Function (#441)
drop embedding table before collection table

Co-authored-by: Mehul <mehul@gndctl.com>
2023-12-20 11:50:24 -08:00
Rey David Dominguez Soto 6ad961ac14 pgvector: support postgres schema (#439) 2023-12-20 11:34:16 -08:00
Bruce Bai eb17026117 test: fix api chain test error (#414) (#434) 2023-12-19 13:48:48 -08:00