Skip to content

Add docs + example #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 402 commits into from
Jun 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
402 commits
Select commit Hold shift + click to select a range
908d151
docs: remove contextual search (#5378)
May 15, 2024
852087a
google-genai[minor]: Add support for video/audio inputs (#5368)
bracesproul May 15, 2024
190d362
all[patch]: Loosen core dependencies (#5367)
bracesproul May 15, 2024
8cf8b05
community[patch]: Release 0.2.0-rc.0 (#5384)
bracesproul May 15, 2024
16bc68b
partnet packages[patch]: Release all (#5388)
bracesproul May 15, 2024
eaafa15
docs: feedback link in banner (#5387)
baskaryan May 15, 2024
b6d711a
anthropic[patch]: Run formatting (#5390)
bracesproul May 15, 2024
db290b6
docs[patch]: update api ref base url to contain v2 subdomain (#5392)
bracesproul May 15, 2024
9d2a9e5
Update debugging and streaming guide content (#5395)
jacoblee93 May 15, 2024
f97adc1
Fix link (#5396)
jacoblee93 May 15, 2024
7bd2384
docs[minor]: Delete 'old' docs folder & contents (#5394)
bracesproul May 15, 2024
69aca46
Guide content fixes (#5400)
jacoblee93 May 15, 2024
a287cae
Update default headers azure & Add Token Provider Check (#5379)
sarangan12 May 15, 2024
e560b7a
openai[patch]: 0.0.31 (#5401) (#5402)
jacoblee93 May 15, 2024
0c8312e
docs[patch]: LangGraph Docs remove unused import from code examples (…
digiorgiu May 15, 2024
f0bf61b
core[major]: Update streamEvent signature to return IterableReadableS…
jacoblee93 May 15, 2024
caa35d4
docs[patch]: Move installation doc to how tos (#5399)
bracesproul May 15, 2024
b4b1f05
fix[runOnDataset]: accept custom criteria in config factory
dqbd May 15, 2024
b414e39
docs[patch]: Add logprob docs, more updates (#5404)
jacoblee93 May 15, 2024
1058368
docs[patch]: Add onlyWsa prop to chat model tabs, other nits (#5405)
bracesproul May 15, 2024
01bac78
docs[minor]: Show sidebar inside how to/tutorial (#5406)
bracesproul May 16, 2024
dfd033e
docs: fix monorepo typo (#5411)
yoogledev May 16, 2024
a9409a5
docs[minor]: Match py how to index page (#5414)
bracesproul May 16, 2024
08ff323
anthropic[minor]: Add tool_choice arg (#5416)
bracesproul May 16, 2024
e05608d
langchain[patch]: Add deprecation warnings to document loaders (#5419)
bracesproul May 16, 2024
5703f0b
docs[patch]: Broken links
bracesproul May 16, 2024
29c0044
docs[patch]: Fix some broken links
bracesproul May 16, 2024
141efd5
docs[patch]: Fix broken links (#5420)
bracesproul May 16, 2024
06045b9
Update text splitter docs (#5424)
jacoblee93 May 16, 2024
0e49b19
docs[minor]: Hide prev/next buttons on how to and tutorials (#5425)
bracesproul May 16, 2024
1a959ef
docs[minor]: Log actual prompt when using prompt hub (#5423)
bracesproul May 16, 2024
98ad207
docs[minor]: version dropdown (#5422)
May 17, 2024
d6bb7a3
docs[minor]: Add tools prompting docs (#5431)
bracesproul May 17, 2024
54ae3f1
docs[patch]: Update API ref url in docs to v02 (#5432)
bracesproul May 17, 2024
0e52651
docs[patch]: Update retrieval and embeddings docs (#5429)
jacoblee93 May 17, 2024
e54f457
Replace prerequisite links component (#5430)
jacoblee93 May 17, 2024
a5ac816
api_refs[minor]: Add version dropdown] (#5435)
bracesproul May 17, 2024
009d47e
core[minor]: Unified model params for LS (#5427)
bracesproul May 17, 2024
1ea411e
docs[patch]: Remove links to missing docs (#5438)
bracesproul May 17, 2024
650dfaf
core[patch]: Move async generator consumption code into local storage…
jacoblee93 May 17, 2024
36e13ec
core[patch]: Release 0.2.0 (next) (#5443)
bracesproul May 17, 2024
28a672a
environment_tests[minor],langchain[minor]: Upgrade core dep to 0.2.0 …
bracesproul May 17, 2024
fd86a6e
langchain[patch]: Release 0.2.0 (next) (#5445)
bracesproul May 17, 2024
58363dc
community[minor]: Bump LC and core deps to 0.2.0 (#5446)
bracesproul May 17, 2024
561b271
community[patch]: Release 0.2.0 (next) (#5447)
bracesproul May 17, 2024
ad1dc8a
@langchain/google-genai [feature]: support Google genai API version a…
sugarforever May 17, 2024
80f87ff
all[minor]: Update partner packages core dep semver (#5448)
bracesproul May 17, 2024
d90511b
partner packages[patch]: Release all (#5449)
bracesproul May 17, 2024
d8911bf
google-pkgs[patch]: Release Google packages (#5450)
bracesproul May 17, 2024
f912600
partner-packages[patch]: Update core dep versions to contain single s…
bracesproul May 17, 2024
55a7e14
Fix styling (#5454)
jacoblee93 May 18, 2024
1aa6512
docs[major]: Fix broken links and turn on throw on broken link (#5455)
bracesproul May 18, 2024
bc892ed
Update QA use-case docs how tos (#5453)
jacoblee93 May 18, 2024
d1fb0eb
Update other howto use-case docs (#5457)
jacoblee93 May 18, 2024
4c94752
docs[patch]: Update tools docs (#5458)
jacoblee93 May 19, 2024
9d137e3
core[patch]: Fix bindTools return type (#5459)
jacoblee93 May 19, 2024
28ece10
groq[patch]: Release 0.0.12 (#5461)
jacoblee93 May 19, 2024
1166acc
anthropic[patch]: Release 0.1.21 (#5462)
jacoblee93 May 19, 2024
9259587
openai[patch]: Release 0.0.33 (#5463)
jacoblee93 May 19, 2024
6dacb4d
google-common[patch]: Release 0.0.16 (#5464)
jacoblee93 May 19, 2024
5533e52
mistralai[patch]: Remove default tool call value for translated messa…
jacoblee93 May 19, 2024
a41216e
mistralai[patch]: Release 0.0.22 (#5465)
jacoblee93 May 19, 2024
e2358e9
docs[patch]: Adds self query docs, LCEL cheatsheet (#5466)
jacoblee93 May 19, 2024
9942804
docs[patch]: Contributor guide, polish (#5468)
jacoblee93 May 19, 2024
62839cf
docs[patch]: Adds callback docs (#5469)
jacoblee93 May 19, 2024
59181ab
Rename doc page (#5470)
jacoblee93 May 20, 2024
14e697f
docs[patch]: Update tutorials (#5473)
jacoblee93 May 20, 2024
c327d58
community[patch]: Neo4j metadata filtering (#5215)
easwee May 20, 2024
a8236e4
google-common[minor],google-genai[minor]: Standardize LS params (#5486)
bracesproul May 20, 2024
05c4c76
Merge pull request #5403 from langchain-ai/dqbd/run-on-dataset-criter…
dqbd May 20, 2024
564708b
community[minor]: Adds support for Cohere Command-R via AWS Bedrock …
m-hamaro May 20, 2024
931e169
docs[patch]: Update output parser docs (#5408)
jacoblee93 May 20, 2024
42e9e17
all[patch]: Ignore no unused vars eslint rule in test files (#5440)
bracesproul May 20, 2024
5daeace
google-genai[patch]: Fix api options which caused requests to hang (#…
bracesproul May 20, 2024
cb01ce3
google-genai[patch]: Release 0.0.15 (#5491)
bracesproul May 20, 2024
a94fdb7
docs[patch]: update Azure documentation and deprecate @langchain/azur…
sinedied May 20, 2024
4e235b6
Fix docs infinite redirect, add redirect (#5492)
jacoblee93 May 20, 2024
eadf62e
Replace ecosystem pages with real links (#5494)
jacoblee93 May 20, 2024
bf73113
community[minor]: updated Browserbase loader (#5412)
mishushakov May 20, 2024
351a34e
community[minor]: Add Google Routes Tool (#5329)
Luisotee May 20, 2024
e79183c
community[minor]: Spider Document Loader (#5415)
WilliamEspegren May 20, 2024
62275b1
community[minor]: feat: Layerup Security integration (#4929)
JamsheedMistri May 21, 2024
a4e3bc4
docs[minor]: Unstructured MD loader doc (#5489)
bracesproul May 21, 2024
9cbb841
community[patch]: VoyageAI embedding with input_type parameter (#5493)
nicolas-geysse May 21, 2024
6060f74
Fix build artifacts (#5496)
jacoblee93 May 21, 2024
bacbfcd
Temporary build fix (#5499)
jacoblee93 May 21, 2024
1d2d395
community[patch]: Release 0.2.1 (#5500)
jacoblee93 May 21, 2024
cd2a96f
scripts[minor]: Fix extra newlines issue, switch all packages to use …
bracesproul May 21, 2024
b3d85e4
docs[minor]: Add AI SDK docs (#5497)
bracesproul May 21, 2024
4839804
Add neo4j metadata filtering docs (#5502)
tomasonjo May 21, 2024
5bdc776
langchain[patch]: Add entrypoints to deprecated omit import map (#5511)
bracesproul May 22, 2024
4482001
langchain[patch]: Release 0.2.1 (#5512)
jacoblee93 May 22, 2024
d574ca4
google-genai[minor]: Add tool calling support (#5507)
bracesproul May 22, 2024
bf4b1c4
google-genai[patch]: Release 0.0.16 (#5513)
bracesproul May 22, 2024
32c89e4
community[minor]: Allow more forms of credentials for aws bedrock (#5…
bracesproul May 22, 2024
94df1ab
docs: move feedback into paginator from content
May 22, 2024
12612cb
core[patch]: Add support for messages in/messages out for RunnableWit…
jacoblee93 May 22, 2024
96324b5
Merge pull request #5516 from langchain-ai/erick/docs-move-feedback-i…
May 22, 2024
d281bdb
docs[patch]: Fix lint (#5526)
jacoblee93 May 23, 2024
544e506
community[patch]: Release 0.2.2 (#5527)
jacoblee93 May 23, 2024
f81c6ef
chore: Update `@google-ai/generativelanguage` module to 2.5.0 (#5523)
OlegIvaniv May 23, 2024
545152c
Bump package (#5529)
jacoblee93 May 23, 2024
e7c87e7
docs[minor]: Add generative UI docs (#5528)
bracesproul May 23, 2024
1087e83
langchain[patch]: Readd dropped entrypoint (#5530)
jacoblee93 May 23, 2024
3ae84b6
Release 0.2.2 (#5531)
jacoblee93 May 23, 2024
607adda
scripts[patch]: Add .js extension to build script (#5536)
bracesproul May 24, 2024
e1178c2
docs[minor]: Multi modal docs (#5537)
bracesproul May 24, 2024
238e093
scripts[major]: New build (#5538)
bracesproul May 24, 2024
cb34587
core[minor]: Stream events v2 (#5539)
jacoblee93 May 25, 2024
668b0bb
community[minor]: Add Upstash Embeddings Support (#5150)
fahreddinozcan May 25, 2024
0f2be54
community[patch]: #3369 Streaming support for Replicate models (#5365)
jeasonnow May 25, 2024
d456148
community[minor]: Add Moonshot chat models integration (#5239)
crazyurus May 25, 2024
bfbd46d
community[minor]: Integrate zep cloud components (#5542)
jacoblee93 May 25, 2024
ea977f8
qdrant[minor]: Support maxMarginalRelevanceSearch() (#5467)
Anush008 May 26, 2024
2a8599a
community[minor]: Add UpstashRatelimitHandler (#5474)
CahidArda May 26, 2024
28785cf
community[minor]: add Neo4j Graph enhancedSchema option (#5413)
easwee May 26, 2024
2494ed7
community[patch]: add ?| (arrayContains) filter on metadata to PGVect…
georgeherby May 26, 2024
ea38e15
community[patch]: Better errors for neo4j vector (#5501)
tomasonjo May 26, 2024
fcc0609
community[patch]: Default embeddingNodeProperty value (#5510)
adam-cowley May 26, 2024
5915fa2
docs[patch]: update callbacks (#5515)
eyurtsev May 26, 2024
4ad6aa7
community[patch]: include metadata returned by Amazon bedrock knowled…
madmed88 May 26, 2024
ea22597
preserve ordinality in postgres when checking existence of documents …
arrested-developer May 26, 2024
0a5988b
docs[minor]: LangGraph Migration Guide (#5487)
hinthornw May 26, 2024
039dc69
qdrant[patch]: Release 0.0.5 (#5543)
jacoblee93 May 26, 2024
e72ac9c
community[patch]: Release 0.2.3 (#5544)
jacoblee93 May 26, 2024
77448e2
core[patch]: Release 0.2.1 (#5545)
jacoblee93 May 26, 2024
1f565fd
pinecone[patch],weaviate[patch]: Bump weaviate and pinecone core deps…
jacoblee93 May 26, 2024
6defc85
pinecone[patch]: Release 0.0.7 (#5547)
jacoblee93 May 26, 2024
ed1f3fb
weaviate[patch]: Release 0.0.4 (#5548)
jacoblee93 May 26, 2024
6d2c228
openai[patch]: fix #5520 (#5521)
jeasonnow May 27, 2024
d79e80d
openai[patch]: Release 0.0.34 (#5562)
jacoblee93 May 28, 2024
a6b9508
core[patch]: Keep event stream for streamEvents v2 open until end of …
jacoblee93 May 28, 2024
be2cc56
core[patch]: Release 0.2.2 (#5563)
jacoblee93 May 28, 2024
61d69f4
docs[patch]: Missing how to index section for multi modal (#5575)
bracesproul May 28, 2024
4cc15c3
api_refs[patch]: Fix link to v0.1 api refs (#5576)
bracesproul May 28, 2024
b444fec
infra[minor]: Speed improvements for CI (#5580)
bracesproul May 28, 2024
ab07b4a
infra[patch]: Improve yarn format (#5578)
bracesproul May 28, 2024
c3ce775
Fixed Typo on Build Simple LLM application page (#5566)
LukeCali-949 May 28, 2024
4b4f611
google-common [patch], google-* [tests]: Fix streaming false (#5571)
afirstenberg May 28, 2024
a320c93
fix: moonshot did not return usage cause error (#5551)
crazyurus May 29, 2024
3747819
google-common[patch]: Zod to Gemini params conversion when the schema…
miguelff May 29, 2024
402d735
google-common[patch]: Release 0.0.17 (#5588)
jacoblee93 May 29, 2024
4ab397c
google-*[patch]: Release 0.0.17 (#5589)
jacoblee93 May 29, 2024
079931f
langchain[patch]: Support for sqljs (#5560)
May 29, 2024
ff47bd2
community[patch]: Upstash Vector Store Namespace Feature (#5557)
fahreddinozcan May 29, 2024
0cc732e
infra[patch]: Set fail-fast strategy to false (#5590)
bracesproul May 29, 2024
63bd7a4
langchain[patch],community[patch]: Loosen peer deps (#5583)
bracesproul May 29, 2024
3eca944
Release 0.2.3 (#5591)
bracesproul May 29, 2024
85f8a3d
community[patch]: Release 0.2.4 (#5592)
bracesproul May 29, 2024
26c353b
infra[major]: Commit yarn cache (#5593)
bracesproul May 29, 2024
6959f56
community[patch]: support stream for wenxin and zhipu chat (#5573)
jeasonnow May 29, 2024
95ba4a3
community[patch]: add support for or in elastic vector query (#5568)
djaffer May 29, 2024
eb93f41
core[patch]: Support LANGSMITH_TRACING env var (#5587)
hinthornw May 29, 2024
9f0b1c3
core[patch]: Set global async local storage instance (#5601)
jacoblee93 May 29, 2024
a204eb0
core[minor]: Make LLMs and chat models always stream when invoked wit…
jacoblee93 May 30, 2024
8be013a
core[patch]: Release 0.2.3 (#5606)
jacoblee93 May 30, 2024
f80a359
docs[patch]: Update README and other links (#5605)
jacoblee93 May 30, 2024
1afc6c2
Transparent handoff between @traceable and LangChain
dqbd May 13, 2024
3de61b5
Add LangSmith to langchain-core internals
dqbd May 13, 2024
7fba45a
Fix CallbackManagerRunTree
dqbd May 13, 2024
ec4c02a
Use singletons
dqbd May 14, 2024
c48394a
Use singletons
dqbd May 14, 2024
94d952a
Resolve circular dependency
dqbd May 15, 2024
f27a2a0
Inherit more properties
dqbd May 20, 2024
7e1d17a
Remove comment, now that we have a singleton
dqbd May 20, 2024
b849f2d
Use [email protected]
dqbd May 21, 2024
3c81e05
Fix base
dqbd May 30, 2024
45ab4a5
Add package
dqbd May 30, 2024
b16042d
Upstream changes from SDK
dqbd May 30, 2024
24a27e1
Update to [email protected]
dqbd May 30, 2024
7d88168
Update base.ts
jacoblee93 May 30, 2024
3fea459
Merge pull request #5339 from langchain-ai/dqbd/langsmith-traceable-h…
dqbd May 30, 2024
d58456e
core[patch]: Release 0.2.4 (#5609)
jacoblee93 May 30, 2024
64bf268
docs: redirect integration links to 0.2 (#5608)
May 30, 2024
331e856
mistralai[minor]: Add llms entrypoint, update chat model integration …
bracesproul May 31, 2024
10f6878
mistralai[patch]: Release 0.0.23 (#5613)
bracesproul May 31, 2024
fc67984
langchain[patch],core[patch]: Fix agent executor stream event behavio…
jacoblee93 May 31, 2024
7d8fa2e
core[minor],openai[patch]: Add usage metadata to `AIMessage`/`Chunk` …
bracesproul May 31, 2024
e9b72d2
core[patch]: Release 0.2.5 (#5615)
jacoblee93 May 31, 2024
76c6110
Bump OpenAI deps (#5616)
jacoblee93 May 31, 2024
2388a8e
openai[minor]: Release 0.1.0 (#5617)
jacoblee93 May 31, 2024
5905549
community[patch],langchain[patch],groq[patch]: Bump deps (#5618)
jacoblee93 May 31, 2024
cc80b12
Release 0.2.4 (#5619)
jacoblee93 May 31, 2024
a2a55e2
community[minor]: DeepInfra embeddings integration #1 (#5382)
ovuruska May 31, 2024
b38e52c
Fix bug in Neo4j new enhancedSchema flag (#5622)
easwee May 31, 2024
153daff
community[minor]: Add support for Tencent Hunyuan Chat Model and Embe…
TeCHiScy May 31, 2024
6371927
Fix security header (#5625)
jacoblee93 May 31, 2024
a32586f
community[patch]: overriding similaritySearchWithScore in neo4j vecto…
AumeshMisra May 31, 2024
2ef21fe
LangGraph fix typo (#5626)
jacoblee93 May 31, 2024
5004a0b
Update import map (#5627)
jacoblee93 May 31, 2024
6d37d22
Remove yarn cache (#5628)
jacoblee93 Jun 1, 2024
d3989f2
community[patch]: Release 0.2.5 (#5629)
jacoblee93 Jun 1, 2024
6fb8ef7
👥 Update LangChain people data (#5630)
jacoblee93 Jun 1, 2024
461c185
Bump flaky better-sqlite3 dep (#5633)
jacoblee93 Jun 1, 2024
e78579f
openai[patch],anthropic[patch]: Populate usage_metadata on invoke, ad…
jacoblee93 Jun 1, 2024
bf87b60
openai[patch]: Release 0.1.1 (#5634)
jacoblee93 Jun 1, 2024
f064ba4
anthropic[minor]: Release 0.2.0 (#5635)
jacoblee93 Jun 1, 2024
77601f7
Switch to monthly shields (#5642)
jacoblee93 Jun 3, 2024
83e7268
docs: fix package path (#5653)
okxiaoliang4 Jun 3, 2024
d7467bf
Update googlevertexai.mdx (#5638)
franzzua Jun 3, 2024
31b9f24
Fix JSDoc parameter description typo (#5644)
Oceansdeep7 Jun 3, 2024
62810d3
docs[patch]: Update Unstructured Docker Image Reference in Documentat…
sarfudheen Jun 4, 2024
156695c
docs[patch]: Add keywords for common queries (#5655)
jacoblee93 Jun 4, 2024
b5de9a6
standard-tests[major], openai[minor]: Init package & add standard tes…
bracesproul Jun 4, 2024
840e787
docs[patch]: Sitemap fixes (#5658)
jacoblee93 Jun 4, 2024
7d7b5ad
anthropic[minor]: Add standard chat model tests to anthropic (#5659)
bracesproul Jun 4, 2024
74cb905
docs[patch]: Update quickstart tutorial (#5662)
jacoblee93 Jun 4, 2024
d6b29b4
mongodb[minor]: add, implement delete method (#5559)
telekosmos Jun 4, 2024
f2a087d
mongodb[patch]: Release 0.0.4 (#5664)
jacoblee93 Jun 4, 2024
d35d12d
community[minor]: upgraded @mlc/web-llm dependency and updated it's C…
tnfssc Jun 4, 2024
294f600
langchain[minor]: add EnsembleRetriever (#5556)
jeasonnow Jun 4, 2024
0744255
community[minor]: Add support for bedrock guardrails and trace (#5631)
QuinnGT Jun 4, 2024
5f81981
Release 0.2.5 (#5665)
jacoblee93 Jun 4, 2024
3b6f29d
docs[patch]: Redirects for LangSmith and LangGraph (#5667)
jacoblee93 Jun 4, 2024
1959ca7
community[patch]: Release 0.2.6 (#5668)
jacoblee93 Jun 4, 2024
e834086
partners[minor]: Add standard chat model tests to partner packages (#…
bracesproul Jun 4, 2024
e9a08aa
core[patch]: Fix formatting mustache image templates (#5666)
bracesproul Jun 5, 2024
a728820
community[minor]: Add standard tests to community chat models (#5669)
bracesproul Jun 5, 2024
0c82d55
core[release]: Release 0.2.6 (#5670)
bracesproul Jun 5, 2024
aa1fb54
docs[patch]: Adds heading keywords for search (#5678)
jacoblee93 Jun 5, 2024
c323a5a
Change neo4j verify connectivity method (#5679)
tomasonjo Jun 6, 2024
ab3eb7e
partners[patch]: Release partner & community packages (#5688)
bracesproul Jun 6, 2024
4d65a34
openai[patch]: Release 0.1.2 (#5689)
bracesproul Jun 6, 2024
423da6a
community[patch]: Deprecate Google PaLM integrations (#5690)
bracesproul Jun 6, 2024
e1c2856
docs[patch]: Adds PDF ingestion and QA tutorial (#5692)
jacoblee93 Jun 6, 2024
cae08ae
Bump dependency range for @langchain/textsplitters (#5693)
jacoblee93 Jun 6, 2024
2898258
textsplitters[patch]: Release 0.0.3 (#5695)
jacoblee93 Jun 6, 2024
f1a019c
docs[patch]: Add deprecation warnings to Google PaLM docs (#5696)
bracesproul Jun 6, 2024
0fc8784
community[patch]: Loosen conflicting peer dep (#5694)
jacoblee93 Jun 6, 2024
e2c6a36
community[patch]: Release 0.2.8 (#5697)
jacoblee93 Jun 6, 2024
25f2127
docs: remove duplicated heading section in rag.ipynb (#5674)
froggy1014 Jun 6, 2024
66ff096
community[patch]: anthropic add tool call support new tools api (#5640)
LordMsz Jun 7, 2024
2de06ad
community[minor]: Fixed ChatWebLLM reload function and updated model …
kaiwinut Jun 7, 2024
a4448fe
community[patch]: Release 0.2.9 (#5698)
jacoblee93 Jun 7, 2024
6535861
docs[patch]: Add crosslinks, add LangGraph and LangSmith sections (#5…
jacoblee93 Jun 7, 2024
39d0f46
docs: add azure dynamic sessions documentation
sinedied Jun 10, 2024
3e9f155
Merge branch 'main' into aca-sessions-docs
sinedied Jun 10, 2024
84c00f3
Fix build and make it CJS compatible
sinedied Jun 10, 2024
e32ebc1
Update error message
sinedied Jun 10, 2024
837da7e
Add sessions to platform docs
sinedied Jun 10, 2024
9bc5dde
Formatting
sinedied Jun 10, 2024
6136878
Add env var
sinedied Jun 10, 2024
5e8aeb2
Add package to examples
sinedied Jun 10, 2024
e36da46
Fix agent example
sinedied Jun 10, 2024
8ae37ef
Add readme
sinedied Jun 10, 2024
a5b4f70
Merge branch 'add-aca-sessions' into aca-sessions-docs
sinedied Jun 10, 2024
e8288a5
Fix bad merge
sinedied Jun 10, 2024
5e8eadf
Add missing package
sinedied Jun 10, 2024
e8f7850
Fix formatting
sinedied Jun 11, 2024
e8caede
Fix langchain/core dependency
sinedied Jun 11, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions docs/core_docs/docs/integrations/platforms/microsoft.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,21 @@ See a [usage example for the Azure Files](/docs/integrations/document_loaders/we
```typescript
import { AzureBlobStorageFileLoader } from "@langchain/community/document_loaders/web/azure_blob_storage_file";
```

## Tools

### Azure Container Apps Dynamic Sessions

> [Azure Container Apps dynamic sessions](https://learn.microsoft.com/azure/container-apps/sessions) provide fast access to secure sandboxed environments that are ideal for running code or applications that require strong isolation from other workloads.

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/azure-dynamic-sessions
```

See a [usage example](/docs/integrations/tools/azure_dynamic_sessions).

```typescript
import { SessionsPythonREPLTool } from "@langchain/azure-dynamic-sessions";
```
42 changes: 42 additions & 0 deletions docs/core_docs/docs/integrations/tools/azure_dynamic_sessions.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Azure Container Apps Dynamic Sessions

> [Azure Container Apps dynamic sessions](https://learn.microsoft.com/azure/container-apps/sessions) provide fast access to secure sandboxed environments that are ideal for running code or applications that require strong isolation from other workloads.

You can learn more about Azure Container Apps dynamic sessions and its code interpretation capabilities on [this page](https://learn.microsoft.com/azure/container-apps/sessions). If you don't have an Azure account, you can [create a free account](https://azure.microsoft.com/free/) to get started.

## Setup

You'll first need to install the [`@langchain/azure-dynamic-sessions`](https://www.npmjs.com/package/@langchain/azure-dynamic-sessions) package:

import IntegrationInstallTooltip from "@mdx_components/integration_install_tooltip.mdx";

<IntegrationInstallTooltip></IntegrationInstallTooltip>

```bash npm2yarn
npm install @langchain/azure-dynamic-sessions
```

You'll also need to have a code interpreter session pool instance running. You can deploy a version using [Azure CLI](https://learn.microsoft.com/cli/azure/install-azure-cli) following [this guide](https://learn.microsoft.com/azure/container-apps/sessions-code-interpreter).

Once you have your instance running, you need to make sure you have properly set up the Azure Entra authentication for it. You can find the instructions on how to do that [here](https://learn.microsoft.com/azure/container-apps/sessions?tabs=azure-cli#authentication).

After you've added the role for your identity, you need to retrieve the **session pool management endpoint**. You can find it in the Azure Portal, under the "Overview" section of your instance. Then you need to set the following environment variable:

import CodeBlock from "@theme/CodeBlock";
import EnvVars from "@examples/tools/azure_dynamic_sessions/.env.example";

<CodeBlock language="text">{EnvVars}</CodeBlock>

## Usage example

Below is a simple example that creates a new Python code interpreter session, invoke the tool and prints the result.

import Example from "@examples/tools/azure_dynamic_sessions/azure_dynamic_sessions.ts";

<CodeBlock language="typescript">{Example}</CodeBlock>

Here is a complete example where we use an Azure OpenAI chat model to call the Python code interpreter session tool to execute the code and get the result:

import AgentExample from "@examples/tools/azure_dynamic_sessions/azure_dynamic_sessions-agent.ts";

<CodeBlock language="typescript">{AgentExample}</CodeBlock>
2 changes: 2 additions & 0 deletions examples/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ AZURE_OPENAI_API_COMPLETIONS_DEPLOYMENT_NAME=ADD_YOURS_HERE # Azure Portal -> Co
AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME=ADD_YOURS_HERE # Azure Portal -> Cognitive Services -> OpenAI -> Choose your instance -> Go to Azure OpenAI Studio -> Deployments
AZURE_OPENAI_API_VERSION=ADD_YOURS_HERE # Azure Portal -> Cognitive Services -> OpenAI -> Choose your instance -> Go to Azure OpenAI Studio -> Completions/Chat -> Choose Deployment -> View Code
AZURE_OPENAI_BASE_PATH=ADD_YOURS_HERE # Azure Portal -> Cognitive Services -> OpenAI -> Choose your instance -> Endpoint (optional)
AZURE_OPENAI_BASE_PATH=ADD_YOURS_HERE # Azure Portal -> Cognitive Services -> OpenAI -> Choose your instance -> Endpoint (optional)
AZURE_CONTAINER_APP_SESSION_POOL_MANAGEMENT_ENDPOINT=ADD_YOURS_HERE # Azure Portal -> Container App Session Pools -> Choose your app -> Pool management endpoint -> Copy the URL
CONNERY_RUNNER_URL=ADD_YOURS_HERE
CONNERY_RUNNER_API_KEY=ADD_YOURS_HERE
ELASTIC_URL=ADD_YOURS_HERE # http://127.0.0.1:9200
Expand Down
1 change: 1 addition & 0 deletions examples/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"@gomomento/sdk": "^1.51.1",
"@google/generative-ai": "^0.7.0",
"@langchain/anthropic": "workspace:*",
"@langchain/azure-dynamic-sessions": "workspace:^",
"@langchain/azure-openai": "workspace:*",
"@langchain/cloudflare": "workspace:*",
"@langchain/cohere": "workspace:*",
Expand Down
1 change: 1 addition & 0 deletions examples/src/tools/azure_dynamic_sessions/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
AZURE_CONTAINER_APP_SESSION_POOL_MANAGEMENT_ENDPOINT=<your_endpoint>
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import type { ChatPromptTemplate } from "@langchain/core/prompts";
import { pull } from "langchain/hub";
import { AgentExecutor, createOpenAIFunctionsAgent } from "langchain/agents";
import { SessionsPythonREPLTool } from "@langchain/azure-dynamic-sessions";
import { AzureChatOpenAI } from "@langchain/openai";

const tools = [
new SessionsPythonREPLTool({
poolManagementEndpoint:
process.env.AZURE_CONTAINER_APP_SESSION_POOL_MANAGEMENT_ENDPOINT || "",
}),
];

// Note: you need a model deployment that supports function calling,
// like `gpt-35-turbo` version `1106`.
const llm = new AzureChatOpenAI({
temperature: 0,
});

// Get the prompt to use - you can modify this!
// If you want to see the prompt in full, you can at:
// https://smith.langchain.com/hub/hwchase17/openai-functions-agent
const prompt = await pull<ChatPromptTemplate>(
"hwchase17/openai-functions-agent"
);

const agent = await createOpenAIFunctionsAgent({
llm,
tools,
prompt,
});

const agentExecutor = new AgentExecutor({
agent,
tools,
});

const result = await agentExecutor.invoke({
input:
"Create a Python program that prints the Python version and return the result.",
});

console.log(result);
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { SessionsPythonREPLTool } from "@langchain/azure-dynamic-sessions";

const tool = new SessionsPythonREPLTool({
poolManagementEndpoint:
process.env.AZURE_CONTAINER_APP_SESSION_POOL_MANAGEMENT_ENDPOINT || "",
});

const result = await tool.invoke("print('Hello, World!')\n1+2");

console.log(result);

// {
// stdout: "Hello, World!\n",
// stderr: "",
// result: 3,
// }
60 changes: 60 additions & 0 deletions libs/langchain-azure-dynamic-sessions/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# @langchain/azure-dynamic-sessions

This package contains the [Azure Container Apps dynamic sessions](https://learn.microsoft.com/azure/container-apps/sessions) tool integration.

Learn more about how to use this tool in the [LangChain documentation](https://js.langchain.com/docs/integrations/tools/azure_dynamic_sessions).

## Installation

```bash npm2yarn
npm install @langchain/azure-dynamic-sessions
```

This package, along with the main LangChain package, depends on [`@langchain/core`](https://npmjs.com/package/@langchain/core/).
If you are using this package with other LangChain packages, you should make sure that all of the packages depend on the same instance of @langchain/core.
You can do so by adding appropriate fields to your project's `package.json` like this:

```json
{
"name": "your-project",
"version": "0.0.0",
"dependencies": {
"@langchain/azure-openai": "^0.0.4",
"langchain": "0.0.207"
},
"resolutions": {
"@langchain/core": "0.1.5"
},
"overrides": {
"@langchain/core": "0.1.5"
},
"pnpm": {
"overrides": {
"@langchain/core": "0.1.5"
}
}
}
```

The field you need depends on the package manager you're using, but we recommend adding a field for the common `yarn`, `npm`, and `pnpm` to maximize compatibility.

## Tool usage

```typescript
import { SessionsPythonREPLTool } from "@langchain/azure-dynamic-sessions";

const tool = new SessionsPythonREPLTool({
poolManagementEndpoint:
process.env.AZURE_CONTAINER_APP_SESSION_POOL_MANAGEMENT_ENDPOINT || "",
});

const result = await tool.invoke("print('Hello, World!')\n1+2");

console.log(result);

// {
// stdout: "Hello, World!\n",
// stderr: "",
// result: 3,
// }
```
2 changes: 1 addition & 1 deletion libs/langchain-azure-dynamic-sessions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
"license": "MIT",
"dependencies": {
"@azure/identity": "^4.2.0",
"@langchain/core": "~0.1",
"@langchain/core": "~0.2",
"uuid": "^9.0.1"
},
"devDependencies": {
Expand Down
24 changes: 16 additions & 8 deletions libs/langchain-azure-dynamic-sessions/src/tools.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,32 @@
import { promises as fs } from "node:fs";
import path from "node:path";
import { fileURLToPath } from "node:url";
import { Tool } from "@langchain/core/tools";
import { getEnvironmentVariable } from "@langchain/core/utils/env";
import {
DefaultAzureCredential,
getBearerTokenProvider,
} from "@azure/identity";
import { v4 as uuidv4 } from "uuid";
import { readFile } from "fs/promises";
import path from "path";
import { fileURLToPath } from "url";

const userAgentPrefix = "langchainjs-azure-dynamic-sessions";

let userAgent = "";
async function getuserAgentSuffix(): Promise<string> {
try {
if (!userAgent) {
const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);
const data = await readFile(
path.join(__dirname, "..", "package.json"),
let currentDir;
try {
currentDir = __dirname;
} catch (e) {
// Workaround to make the build compatible with both ESM and CJS
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
currentDir = path.dirname(fileURLToPath(import.meta.url));
}

const data = await fs.readFile(
path.join(currentDir, "..", "package.json"),
"utf8"
);
const json = await JSON.parse(data);
Expand Down Expand Up @@ -119,7 +127,7 @@ export class SessionsPythonREPLTool extends Tool {
"";

if (!this.poolManagementEndpoint) {
throw new Error("poolManagementEndpoint is required.");
throw new Error("poolManagementEndpoint must be defined.");
}

this.sessionId = params?.sessionId ?? uuidv4();
Expand Down
5 changes: 3 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8954,13 +8954,13 @@ __metadata:
languageName: unknown
linkType: soft

"@langchain/azure-dynamic-sessions@workspace:libs/langchain-azure-dynamic-sessions":
"@langchain/azure-dynamic-sessions@workspace:^, @langchain/azure-dynamic-sessions@workspace:libs/langchain-azure-dynamic-sessions":
version: 0.0.0-use.local
resolution: "@langchain/azure-dynamic-sessions@workspace:libs/langchain-azure-dynamic-sessions"
dependencies:
"@azure/identity": ^4.2.0
"@jest/globals": ^29.5.0
"@langchain/core": ~0.1
"@langchain/core": ~0.2
"@langchain/scripts": ~0.0
"@swc/core": ^1.3.90
"@swc/jest": ^0.2.29
Expand Down Expand Up @@ -22596,6 +22596,7 @@ __metadata:
"@gomomento/sdk": ^1.51.1
"@google/generative-ai": ^0.7.0
"@langchain/anthropic": "workspace:*"
"@langchain/azure-dynamic-sessions": "workspace:^"
"@langchain/azure-openai": "workspace:*"
"@langchain/cloudflare": "workspace:*"
"@langchain/cohere": "workspace:*"
Expand Down
Loading