{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":714254838,"defaultBranch":"main","name":"skypoint-langchain","ownerLogin":"skypointcloud","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2023-11-04T11:23:55.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/8270611?v=4","public":true,"private":false,"isOrgOwned":true},"refInfo":{"name":"","listCacheKey":"v0:1719907070.0","currentOid":""},"activityList":{"items":[{"before":"852d2e71ead28870937394568d84d19918de3a1c","after":"3147269cd7b89c52b99fb45cf1dd29d77a5f8fff","ref":"refs/heads/users/sushantburnawal/feature/sherloq-retry-tool","pushedAt":"2024-09-04T12:59:37.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"chore: Update langchain version to 0.2.8dev1 and include columns in query execution","shortMessageHtmlLink":"chore: Update langchain version to 0.2.8dev1 and include columns in q…"}},{"before":"e308c7804ae721c7be26d3096b2faa8884a2b723","after":"852d2e71ead28870937394568d84d19918de3a1c","ref":"refs/heads/users/sushantburnawal/feature/sherloq-retry-tool","pushedAt":"2024-07-14T09:22:37.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"chore: Update langchain version to 0.2.7dev1 and include columns in query execution","shortMessageHtmlLink":"chore: Update langchain version to 0.2.7dev1 and include columns in q…"}},{"before":"c8ad59b688e4f8466360d430aa111d1c2bfcecf5","after":"e308c7804ae721c7be26d3096b2faa8884a2b723","ref":"refs/heads/users/sushantburnawal/feature/sherloq-retry-tool","pushedAt":"2024-07-03T09:27:02.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"chore: Bump langchain version to 0.2.12dev1","shortMessageHtmlLink":"chore: Bump langchain version to 0.2.12dev1"}},{"before":null,"after":"c8ad59b688e4f8466360d430aa111d1c2bfcecf5","ref":"refs/heads/users/sushantburnawal/feature/sherloq-retry-tool","pushedAt":"2024-07-02T07:57:50.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"feat: Add RetrySqlQueryCreatorTool for handling failed SQL query generation","shortMessageHtmlLink":"feat: Add RetrySqlQueryCreatorTool for handling failed SQL query gene…"}},{"before":"eb0adef3e9ddc2ed434bfabfb1df872b9a2eccc4","after":"44e9c005f114a3b74ad3ceb87698d4044c012875","ref":"refs/heads/main","pushedAt":"2024-06-27T06:29:54.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Merge langchain==0.2.6 to skypoint-langchain (#14)\n\n* partners: fix numpy dep (#22858)\r\n\r\nFollowing https://github.com/langchain-ai/langchain/pull/22813, which\r\nadded python 3.12 to CI, here we update numpy accordingly in partner\r\npackages.\r\n\r\n* [docs]: added info for TavilySearchResults (#22765)\r\n\r\n* experimental[major]: Force users to opt-in into code that relies on the python repl (#22860)\r\n\r\nThis should make it obvious that a few of the agents in langchain\r\nexperimental rely on the python REPL as a tool under the hood, and will\r\nforce users to opt-in.\r\n\r\n* community[patch]: FAISS VectorStore deserializer should be opt-in (#22861)\r\n\r\nFAISS deserializer uses pickle module. Users have to opt-in to\r\nde-serialize.\r\n\r\n* ci: Add script to check for pickle usage in community (#22863)\r\n\r\nAdd script to check for pickle usage in community.\r\n\r\n* experimental[patch]/docs[patch]: Update links to security docs (#22864)\r\n\r\nMinor update to newest version of security docs (content should be\r\nidentical).\r\n\r\n* core: In astream_events v2 propagate cancel/break to the inner astream call (#22865)\r\n\r\n- previous behavior was for the inner astream to continue running with\r\nno interruption\r\n- also propagate break in core runnable methods\r\n\r\n* core[patch]: Treat type as a special field when merging lists (#22750)\r\n\r\nShould we even log a warning? At least for Anthropic, it's expected to\r\nget e.g. `text_block` followed by `text_delta`.\r\n\r\n@ccurme @baskaryan @efriis\r\n\r\n* core: release 0.2.6 (#22868)\r\n\r\n* langchain: release 0.2.4 (#22872)\r\n\r\n* Fix: lint errors and update Field alias in models.py and AutoSelectionScorer initialization (#22846)\r\n\r\nThis PR addresses several lint errors in the core package of LangChain.\r\nSpecifically, the following issues were fixed:\r\n\r\n1.Unexpected keyword argument \"required\" for \"Field\" [call-arg]\r\n2.tests/integration_tests/chains/test_cpal.py:263: error: Unexpected\r\nkeyword argument \"narrative_input\" for \"QueryModel\" [call-arg]\r\n\r\n* Fix typo in vearch.md (#22840)\r\n\r\nFix typo\r\n\r\n* docs: s/path_images/images/ for ImageCaptionLoader keyword arguments (#22857)\r\n\r\nQuick update to `ImageCaptionLoader` documentation to reflect what's in\r\ncode.\r\n\r\n* docs: update NVIDIA Riva tool to use NVIDIA NIM for LLM (#22873)\r\n\r\n**Description:**\r\nUpdate the NVIDIA Riva tool documentation to use NVIDIA NIM for the LLM.\r\nShow how to use NVIDIA NIMs and link to documentation for LangChain with\r\nNIM.\r\n\r\n---------\r\n\r\nCo-authored-by: Hayden Wolff \r\nCo-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>\r\n\r\n* docs, cli[patch]: document loaders doc template (#22862)\r\n\r\nFrom: https://github.com/langchain-ai/langchain/pull/22290\r\n\r\n---------\r\n\r\nCo-authored-by: Eugene Yurtsev \r\n\r\n* cli[patch]: Release 0.0.25 (#22876)\r\n\r\n* infra: lint new docs to match doc loader template (#22867)\r\n\r\n* docs: fixes for Elasticsearch integrations, cache doc and providers list (#22817)\r\n\r\nSome minor fixes in the documentation:\r\n - ElasticsearchCache initilization is now correct\r\n - List of integrations for ES updated\r\n\r\n* docs: `ReAct` reference (#22830)\r\n\r\nThe `ReAct` is used all across LangChain but it is not referenced\r\nproperly.\r\nAdded references to the original paper.\r\n\r\n* community[minor]: Implement ZhipuAIEmbeddings interface (#22821)\r\n\r\n- **Description:** Implement ZhipuAIEmbeddings interface, include:\r\n - The `embed_query` method\r\n - The `embed_documents` method\r\n\r\nrefer to [ZhipuAI\r\nEmbedding-2](https://open.bigmodel.cn/dev/api#text_embedding)\r\n\r\n---------\r\n\r\nCo-authored-by: Eugene Yurtsev \r\n\r\n* docs: Astra DB vectorstore, adjust syntax for automatic-embedding example (#22833)\r\n\r\nDescription: Adjusting the syntax for creating the vectorstore\r\ncollection (in the case of automatic embedding computation) for the most\r\nidiomatic way to submit the stored secret name.\r\n\r\nCo-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>\r\n\r\n* community[minor]: Prem Templates (#22783)\r\n\r\nThis PR adds the feature add Prem Template feature in ChatPremAI.\r\nAdditionally it fixes a minor bug for API auth error when API passed\r\nthrough arguments.\r\n\r\n* qdrant[patch]: Use collection_exists API instead of exceptions (#22764)\r\n\r\n## Description\r\n\r\nCurrently, the Qdrant integration relies on exceptions raised by\r\n[`get_collection`\r\n](https://qdrant.tech/documentation/concepts/collections/#collection-info)\r\nto check if a collection exists.\r\n\r\nUsing\r\n[`collection_exists`](https://qdrant.tech/documentation/concepts/collections/#check-collection-existence)\r\nis recommended to avoid missing any unhandled exceptions. This PR\r\naddresses this.\r\n\r\n## Testing\r\nAll integration and unit tests pass. No user-facing changes.\r\n\r\n* docs: Standardize ChatGroq (#22751)\r\n\r\nUpdated ChatGroq doc string as per issue\r\nhttps://github.com/langchain-ai/langchain/issues/22296:\"langchain_groq:\r\nupdated docstring for ChatGroq in langchain_groq to match that of the\r\ndescription (in the appendix) provided in issue\r\nhttps://github.com/langchain-ai/langchain/issues/22296. \"\r\n\r\nIssue: This PR is in response to issue\r\nhttps://github.com/langchain-ai/langchain/issues/22296, and more\r\nspecifically the ChatGroq model. In particular, this PR updates the\r\ndocstring for langchain/libs/partners/groq/langchain_groq/chat_model.py\r\nby adding the following sections: Instantiate, Invoke, Stream, Async,\r\nTool calling, Structured Output, and Response metadata. I used the\r\ntemplate from the Anthropic implementation and referenced the Appendix\r\nof the original issue post. I also noted that: `usage_metadata `returns\r\nnone for all ChatGroq models I tested; there is no mention of image\r\ninput in the ChatGroq documentation; unlike that of ChatHuggingFace,\r\n`.stream(messages)` for ChatGroq returned blocks of output.\r\n\r\n---------\r\n\r\nCo-authored-by: lucast2021 \r\nCo-authored-by: Bagatur \r\n\r\n* anthropic[patch]: always add tool_result type to ToolMessage content (#22721)\r\n\r\nAnthropic tool results can contain image data, which are typically\r\nrepresented with content blocks having `\"type\": \"image\"`. Currently,\r\nthese content blocks are passed as-is as human/user messages to\r\nAnthropic, which raises BadRequestError as it expects a tool_result\r\nblock to follow a tool_use.\r\n\r\nHere we update ChatAnthropic to nest the content blocks inside a\r\ntool_result content block.\r\n\r\nExample:\r\n```python\r\nimport base64\r\n\r\nimport httpx\r\nfrom langchain_anthropic import ChatAnthropic\r\nfrom langchain_core.messages import AIMessage, HumanMessage, ToolMessage\r\nfrom langchain_core.pydantic_v1 import BaseModel, Field\r\n\r\n\r\n# Fetch image\r\nimage_url = \"https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg\"\r\nimage_data = base64.b64encode(httpx.get(image_url).content).decode(\"utf-8\")\r\n\r\n\r\nclass FetchImage(BaseModel):\r\n should_fetch: bool = Field(..., description=\"Whether an image is requested.\")\r\n\r\n\r\nllm = ChatAnthropic(model=\"claude-3-sonnet-20240229\").bind_tools([FetchImage])\r\n\r\nmessages = [\r\n HumanMessage(content=\"Could you summon a beautiful image please?\"),\r\n AIMessage(\r\n content=[\r\n {\r\n \"type\": \"tool_use\",\r\n \"id\": \"toolu_01Rn6Qvj5m7955x9m9Pfxbcx\",\r\n \"name\": \"FetchImage\",\r\n \"input\": {\"should_fetch\": True},\r\n },\r\n ],\r\n tool_calls=[\r\n {\r\n \"name\": \"FetchImage\",\r\n \"args\": {\"should_fetch\": True},\r\n \"id\": \"toolu_01Rn6Qvj5m7955x9m9Pfxbcx\",\r\n },\r\n ],\r\n ),\r\n ToolMessage(\r\n name=\"FetchImage\",\r\n content=[\r\n {\r\n \"type\": \"image\",\r\n \"source\": {\r\n \"type\": \"base64\",\r\n \"media_type\": \"image/jpeg\",\r\n \"data\": image_data,\r\n },\r\n },\r\n ],\r\n tool_call_id=\"toolu_01Rn6Qvj5m7955x9m9Pfxbcx\",\r\n ),\r\n]\r\n\r\nllm.invoke(messages)\r\n```\r\n\r\nTrace:\r\nhttps://smith.langchain.com/public/d27e4fc1-a96d-41e1-9f52-54f5004122db/r\r\n\r\n* docs[patch]: Expand embeddings docs (#22881)\r\n\r\n* docs: generate table for document loaders (#22871)\r\n\r\nCo-authored-by: Bagatur \r\n\r\n* docs: doc loader feat table alignment (#22900)\r\n\r\n* community[minor]: add chat model llamacpp (#22589)\r\n\r\n- **PR title**: [community] add chat model llamacpp\r\n\r\n\r\n- **PR message**:\r\n- **Description:** This PR introduces a new chat model integration with\r\nllamacpp_python, designed to work similarly to the existing ChatOpenAI\r\nmodel.\r\n + Work well with instructed chat, chain and function/tool calling.\r\n+ Work with LangGraph (persistent memory, tool calling), will update\r\nsoon\r\n\r\n- **Dependencies:** This change requires the llamacpp_python library to\r\nbe installed.\r\n \r\n@baskaryan\r\n\r\n---------\r\n\r\nCo-authored-by: Bagatur \r\nCo-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>\r\n\r\n* docs: Fix typo in tutorial about structured data extraction (#22888)\r\n\r\n[Fixed typo](docs: Fix typo in tutorial about structured data\r\nextraction)\r\n\r\n* [Community]: HuggingFaceCrossEncoder `score` accounting for pairs. (#22578)\r\n\r\n- **Description:** Some of the Cross-Encoder models provide scores in\r\npairs, i.e., . However, the `HuggingFaceCrossEncoder`\r\n`score` method does not currently take into account the pair situation.\r\nThis PR addresses this issue by modifying the method to consider only\r\nthe relevant score if score is being provided in pair. The reason for\r\nfocusing on the relevant score is that the compressors select the top-n\r\ndocuments based on relevance.\r\n - **Issue:** #22556 \r\n- Please also refer to this\r\n[comment](https://github.com/UKPLab/sentence-transformers/issues/568#issuecomment-729153075)\r\n\r\n* fireworks[patch]: add usage_metadata to (a)invoke and (a)stream (#22906)\r\n\r\n* anthropic[minor]: Adds streaming tool call support for Anthropic (#22687)\r\n\r\nPreserves string content chunks for non tool call requests for\r\nconvenience.\r\n\r\nOne thing - Anthropic events look like this:\r\n\r\n```\r\nRawContentBlockStartEvent(content_block=TextBlock(text='', type='text'), index=0, type='content_block_start')\r\nRawContentBlockDeltaEvent(delta=TextDelta(text='\\nThe', type='text_delta'), index=0, type='content_block_delta')\r\nRawContentBlockDeltaEvent(delta=TextDelta(text=' provide', type='text_delta'), index=0, type='content_block_delta')\r\n...\r\nRawContentBlockStartEvent(content_block=ToolUseBlock(id='toolu_01GJ6x2ddcMG3psDNNe4eDqb', input={}, name='get_weather', type='tool_use'), index=1, type='content_block_start')\r\nRawContentBlockDeltaEvent(delta=InputJsonDelta(partial_json='', type='input_json_delta'), index=1, type='content_block_delta')\r\n```\r\n\r\nNote that `delta` has a `type` field. With this implementation, I'm\r\ndropping it because `merge_list` behavior will concatenate strings.\r\n\r\nWe currently have `index` as a special field when merging lists, would\r\nit be worth adding `type` too?\r\n\r\nIf so, what do we set as a context block chunk? `text` vs.\r\n`text_delta`/`tool_use` vs `input_json_delta`?\r\n\r\nCC @ccurme @efriis @baskaryan\r\n\r\n* core[patch]: fix validation of @deprecated decorator (#22513)\r\n\r\nThis PR moves the validation of the decorator to a better place to avoid\r\ncreating bugs while deprecating code.\r\n\r\nPrevent issues like this from arising:\r\nhttps://github.com/langchain-ai/langchain/issues/22510\r\n\r\nwe should replace with a linter at some point that just does static\r\nanalysis\r\n\r\n* community[patch]: SitemapLoader restrict depth of parsing sitemap (CVE-2024-2965) (#22903)\r\n\r\nThis PR restricts the depth to which the sitemap can be parsed.\r\n\r\nFix for: CVE-2024-2965\r\n\r\n* community[major], experimental[patch]: Remove Python REPL from community (#22904)\r\n\r\nRemove the REPL from community, and suggest an alternative import from\r\nlangchain_experimental.\r\n\r\nFix for this issue:\r\nhttps://github.com/langchain-ai/langchain/issues/14345\r\n\r\nThis is not a bug in the code or an actual security risk. The python\r\nREPL itself is behaving as expected.\r\n\r\nThe PR is done to appease blanket security policies that are just\r\nlooking for the presence of exec in the code.\r\n\r\n---------\r\n\r\nCo-authored-by: Erick Friis \r\n\r\n* community[minor]: Fix long_context_reorder.py async (#22839)\r\n\r\nImplement `async def atransform_documents( self, documents:\r\nSequence[Document], **kwargs: Any ) -> Sequence[Document]` for\r\n`LongContextReorder`\r\n\r\n* core[patch]: Fix FunctionCallbackHandler._on_tool_end (#22908)\r\n\r\nIf the global `debug` flag is enabled, the agent will get the following\r\nerror in `FunctionCallbackHandler._on_tool_end` at runtime.\r\n\r\n```\r\nError in ConsoleCallbackHandler.on_tool_end callback: AttributeError(\"'list' object has no attribute 'strip'\")\r\n```\r\n\r\nBy calling str() before strip(), the error was avoided.\r\nThis error can be seen at\r\n[debugging.ipynb](https://github.com/langchain-ai/langchain/blob/master/docs/docs/how_to/debugging.ipynb).\r\n\r\n- Issue: NA\r\n- Dependencies: NA\r\n- Twitter handle: https://x.com/kiarina37\r\n\r\n* dcos: Add admonition to PythonREPL tool (#22909)\r\n\r\nAdd admonition to the documentation to make sure users are aware that\r\nthe tool allows execution of code on the host machine using a python\r\ninterpreter (by design).\r\n\r\n* docs: add groq to chatmodeltabs (#22913)\r\n\r\n* experimental: LLMGraphTransformer - added relationship properties. (#21856)\r\n\r\n- **Description:** \r\nThe generated relationships in the graph had no properties, but the\r\nRelationship class was properly defined with properties. This made it\r\nvery difficult to transform conditional sentences into a graph. Adding\r\nproperties to relationships can solve this issue elegantly.\r\nThe changes expand on the existing LLMGraphTransformer implementation\r\nbut add the possibility to define allowed relationship properties like\r\nthis: LLMGraphTransformer(llm=llm, relationship_properties=[\"Condition\",\r\n\"Time\"],)\r\n- **Issue:** \r\n no issue found\r\n - **Dependencies:**\r\n n/a\r\n- **Twitter handle:** \r\n @IstvanSpace\r\n\r\n\r\n-Quick Test\r\n=================================================================\r\nfrom dotenv import load_dotenv\r\nimport os\r\nfrom langchain_community.graphs import Neo4jGraph\r\nfrom langchain_experimental.graph_transformers import\r\nLLMGraphTransformer\r\nfrom langchain_openai import ChatOpenAI\r\nfrom langchain_core.prompts import ChatPromptTemplate\r\nfrom langchain_core.documents import Document\r\n\r\nload_dotenv()\r\nos.environ[\"NEO4J_URI\"] = os.getenv(\"NEO4J_URI\")\r\nos.environ[\"NEO4J_USERNAME\"] = os.getenv(\"NEO4J_USERNAME\")\r\nos.environ[\"NEO4J_PASSWORD\"] = os.getenv(\"NEO4J_PASSWORD\")\r\ngraph = Neo4jGraph()\r\nllm = ChatOpenAI(temperature=0, model_name=\"gpt-4o\")\r\nllm_transformer = LLMGraphTransformer(llm=llm)\r\n#text = \"Harry potter likes pies, but only if it rains outside\"\r\ntext = \"Jack has a dog named Max. Jack only walks Max if it is sunny\r\noutside.\"\r\ndocuments = [Document(page_content=text)]\r\nllm_transformer_props = LLMGraphTransformer(\r\n llm=llm,\r\n relationship_properties=[\"Condition\"],\r\n)\r\ngraph_documents_props =\r\nllm_transformer_props.convert_to_graph_documents(documents)\r\nprint(f\"Nodes:{graph_documents_props[0].nodes}\")\r\nprint(f\"Relationships:{graph_documents_props[0].relationships}\")\r\ngraph.add_graph_documents(graph_documents_props)\r\n\r\n---------\r\n\r\nCo-authored-by: Istvan Lorincz \r\nCo-authored-by: Bagatur <22008038+baskaryan@users.noreply.github.com>\r\n\r\n* core: in astream_events v2 always await task even if already finished (#22916)\r\n\r\n- this ensures exceptions propagate to the caller\r\n\r\n* core: release 0.2.7 (#22917)\r\n\r\n* infra: remove nvidia from monorepo scheduled tests (#22915)\r\n\r\nScheduled tests run in\r\nhttps://github.com/langchain-ai/langchain-nvidia/tree/main\r\n\r\n* docs: Fix wrongly referenced class name in confluence.py (#22879)\r\n\r\nFixes #22542\r\n\r\nChanged ConfluenceReader to ConfluenceLoader\r\n\r\n* templates: remove lockfiles (#22920)\r\n\r\npoetry will default to latest versions without\r\n\r\n* langchain: release 0.2.5 (#22922)\r\n\r\n* text-splitters[patch]: Fix HTMLSectionSplitter (#22812)\r\n\r\nUpdate former pull request:\r\nhttps://github.com/langchain-ai/langchain/pull/22654.\r\n\r\nModified `langchain_text_splitters.HTMLSectionSplitter`, where in the\r\nlatest version `dict` data structure is used to store sections from a\r\nhtml document, in function `split_html_by_headers`. The header/section\r\nelement names serve as dict keys. This can be a problem when duplicate\r\nheader/section element names are present in a single html document.\r\nLatter ones can replace former ones with the same name. Therefore some\r\ncontents can be miss after html text splitting is conducted.\r\n\r\nUsing a list to store sections can hopefully solve the problem. A Unit\r\ntest considering duplicate header names has been added.\r\n\r\n---------\r\n\r\nCo-authored-by: Bagatur \r\n\r\n* community: release 0.2.5 (#22923)\r\n\r\n* cli[minor]: remove redefined DEFAULT_GIT_REF (#21471)\r\n\r\nremove redefined DEFAULT_GIT_REF\r\n\r\nCo-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>\r\n\r\n* experimental: release 0.0.61 (#22924)\r\n\r\n* docs: add ollama json mode (#22926)\r\n\r\nfixes #22910\r\n\r\n* community: 'Solve the issue where the _search function in ElasticsearchStore supports passing a query_vector parameter, but the parameter does not take effect. (#21532)\r\n\r\n**Issue:**\r\nWhen using the similarity_search_with_score function in\r\nElasticsearchStore, I expected to pass in the query_vector that I have\r\nalready obtained. I noticed that the _search function does support the\r\nquery_vector parameter, but it seems to be ineffective. I am attempting\r\nto resolve this issue.\r\n\r\nCo-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>\r\n\r\n* Update ollama.py with optional raw setting. (#21486)\r\n\r\nOllama has a raw option now. \r\n\r\nhttps://github.com/ollama/ollama/blob/main/docs/api.md\r\n\r\nThank you for contributing to LangChain!\r\n\r\n- [ ] **PR title**: \"package: description\"\r\n- Where \"package\" is whichever of langchain, community, core,\r\nexperimental, etc. is being modified. Use \"docs: ...\" for purely docs\r\nchanges, \"templates: ...\" for template changes, \"infra: ...\" for CI\r\nchanges.\r\n - Example: \"community: add foobar LLM\"\r\n\r\n\r\n- [ ] **PR message**: ***Delete this entire checklist*** and replace\r\nwith\r\n - **Description:** a description of the change\r\n - **Issue:** the issue # it fixes, if applicable\r\n - **Dependencies:** any dependencies required for this change\r\n- **Twitter handle:** if your PR gets announced, and you'd like a\r\nmention, we'll gladly shout you out!\r\n\r\n\r\n- [ ] **Add tests and docs**: If you're adding a new integration, please\r\ninclude\r\n1. a test for the integration, preferably unit tests that do not rely on\r\nnetwork access,\r\n2. an example notebook showing its use. It lives in\r\n`docs/docs/integrations` directory.\r\n\r\n\r\n- [ ] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\nAdditional guidelines:\r\n- Make sure optional dependencies are imported within a function.\r\n- Please do not add dependencies to pyproject.toml files (even optional\r\nones) unless they are required for unit tests.\r\n- Most PRs should not touch more than one package.\r\n- Changes should be backwards compatible.\r\n- If you are adding something to community, do not re-import it in\r\nlangchain.\r\n\r\nIf no one reviews your PR within a few days, please @-mention one of\r\nbaskaryan, efriis, eyurtsev, hwchase17.\r\n\r\n---------\r\n\r\nCo-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>\r\nCo-authored-by: isaac hershenson \r\n\r\n* docs:Fix mispelling in streaming doc (#22936)\r\n\r\nDescription: Fix mispelling\r\nIssue: None\r\nDependencies: None\r\nTwitter handle: None\r\n\r\nCo-authored-by: qcloud \r\n\r\n* docs: update ZhipuAI ChatModel docstring (#22934)\r\n\r\n- **Description:** Update ZhipuAI ChatModel rich docstring\r\n- **Issue:** the issue #22296\r\n\r\n* Improve llm graph transformer docstring (#22939)\r\n\r\n* infra: update integration test workflow (#22945)\r\n\r\n* community(you): Better support for You.com News API (#22622)\r\n\r\n## Description\r\nWhile `YouRetriever` supports both You.com's Search and News APIs, news\r\nis supported as an afterthought.\r\nMore specifically, not all of the News API parameters are exposed for\r\nthe user, only those that happen to overlap with the Search API.\r\n\r\nThis PR:\r\n- improves support for both APIs, exposing the remaining News API\r\nparameters while retaining backward compatibility\r\n- refactor some REST parameter generation logic\r\n- updates the docstring of `YouSearchAPIWrapper`\r\n- add input validation and warnings to ensure parameters are properly\r\nset by user\r\n- 🚨 Breaking: Limit the news results to `k` items\r\n\r\nIf no one reviews your PR within a few days, please @-mention one of\r\nbaskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.\r\n\r\n* docs: nim model name update (#22943)\r\n\r\nNIM Model name change in a notebook and mdx file.\r\n\r\nThanks!\r\n\r\n* standard-tests[patch]: don't require str chunk contents (#22965)\r\n\r\n* Update sql_qa.ipynb (#22966)\r\n\r\nfixes #22798 \r\nfixes #22963\r\n\r\n* docs: update databricks.ipynb (#22949)\r\n\r\narbitary -> arbitrary\r\n\r\n* docs: Standardise formatting (#22948)\r\n\r\nStandardised formatting \r\n\r\n\r\n![image](https://github.com/langchain-ai/langchain/assets/73015364/ea3b5c5c-e7a6-4bb7-8c6b-e7d8cbbbf761)\r\n\r\n* [Partner]: Add metadata to stream response (#22716)\r\n\r\nAdds `response_metadata` to stream responses from OpenAI. This is\r\nreturned with `invoke` normally, but wasn't implemented for `stream`.\r\n\r\n---------\r\n\r\nCo-authored-by: Chester Curme \r\n\r\n* standard-tests[patch]: Release 0.1.1 (#22984)\r\n\r\n* docs: Update llamacpp ntbk (#22907)\r\n\r\nCo-authored-by: Bagatur \r\n\r\n* community[minor]: add `ChatSnowflakeCortex` chat model (#21490)\r\n\r\n**Description:** This PR adds a chat model integration for [Snowflake\r\nCortex](https://docs.snowflake.com/en/user-guide/snowflake-cortex/llm-functions),\r\nwhich gives an instant access to industry-leading large language models\r\n(LLMs) trained by researchers at companies like Mistral, Reka, Meta, and\r\nGoogle, including [Snowflake\r\nArctic](https://www.snowflake.com/en/data-cloud/arctic/), an open\r\nenterprise-grade model developed by Snowflake.\r\n\r\n**Dependencies:** Snowflake's\r\n[snowpark](https://pypi.org/project/snowflake-snowpark-python/) library\r\nis required for using this integration.\r\n\r\n**Twitter handle:** [@gethouseware](https://twitter.com/gethouseware)\r\n\r\n- [x] **Add tests and docs**:\r\n1. integration tests:\r\n`libs/community/tests/integration_tests/chat_models/test_snowflake.py`\r\n2. unit tests:\r\n`libs/community/tests/unit_tests/chat_models/test_snowflake.py`\r\n 3. example notebook: `docs/docs/integrations/chat/snowflake.ipynb`\r\n\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\n* openai[patch]: add stream_usage parameter (#22854)\r\n\r\nHere we add `stream_usage` to ChatOpenAI as:\r\n\r\n1. a boolean attribute\r\n2. a kwarg to _stream and _astream.\r\n\r\nQuestion: should the `stream_usage` attribute be `bool`, or `bool |\r\nNone`?\r\n\r\nCurrently I've kept it `bool` and defaulted to False. It was implemented\r\non\r\n[ChatAnthropic](https://github.com/langchain-ai/langchain/blob/e832bbb48627aa9f00614e82e7ace60b7d8957c6/libs/partners/anthropic/langchain_anthropic/chat_models.py#L535)\r\nas a bool. However, to maintain support for users who access the\r\nbehavior via OpenAI's `stream_options` param, this ends up being\r\npossible:\r\n```python\r\nllm = ChatOpenAI(model_kwargs={\"stream_options\": {\"include_usage\": True}})\r\nassert not llm.stream_usage\r\n```\r\n(and this model will stream token usage).\r\n\r\nSome options for this:\r\n- it's ok\r\n- make the `stream_usage` attribute bool or None\r\n- make an \\_\\_init\\_\\_ for ChatOpenAI, set a `._stream_usage` attribute\r\nand read `.stream_usage` from a property\r\n\r\nOpen to other ideas as well.\r\n\r\n* community: Add Baichuan Embeddings batch size (#22942)\r\n\r\n- **Support batch size** \r\nBaichuan updates the document, indicating that up to 16 documents can be\r\nimported at a time\r\n\r\n- **Standardized model init arg names**\r\n - baichuan_api_key -> api_key\r\n - model_name -> model\r\n\r\n* Add RAG to conceptual guide (#22790)\r\n\r\nCo-authored-by: jacoblee93 \r\n\r\n* docs: update universal init title (#22990)\r\n\r\n* community[minor]: add tool calling for DeepInfraChat (#22745)\r\n\r\nDeepInfra now supports tool calling for supported models.\r\n\r\n---------\r\n\r\nCo-authored-by: Bagatur \r\n\r\n* docs[patch]: Reorder streaming guide, add tags (#22993)\r\n\r\nCC @hinthornw\r\n\r\n* docs: Add some 3rd party tutorials (#22931)\r\n\r\nLangchain is very popular among developers in China, but there are still\r\nno good Chinese books or documents, so I want to add my own Chinese\r\nresources on langchain topics, hoping to give Chinese readers a better\r\nexperience using langchain. This is not a translation of the official\r\nlangchain documentation, but my understanding.\r\n\r\n---------\r\n\r\nCo-authored-by: ccurme \r\n\r\n* standard-tests[patch]: Update chat model standard tests (#22378)\r\n\r\n- Refactor standard test classes to make them easier to configure\r\n- Update openai to support stop_sequences init param\r\n- Update groq to support stop_sequences init param\r\n- Update fireworks to support max_retries init param\r\n- Update ChatModel.bind_tools to type tool_choice\r\n- Update groq to handle tool_choice=\"any\". **this may be controversial**\r\n\r\n---------\r\n\r\nCo-authored-by: Chester Curme \r\n\r\n* core: run_in_executor: Wrap StopIteration in RuntimeError (#22997)\r\n\r\n- StopIteration can't be set on an asyncio.Future it raises a TypeError\r\nand leaves the Future pending forever so we need to convert it to a\r\nRuntimeError\r\n\r\n* infra: test all dependents on any change (#22994)\r\n\r\n* core[patch]: Release 0.2.8 (#23012)\r\n\r\n* community: OCI GenAI embedding batch size (#22986)\r\n\r\nThank you for contributing to LangChain!\r\n\r\n- [x] **PR title**: \"community: OCI GenAI embedding batch size\"\r\n\r\n\r\n\r\n- [x] **PR message**:\r\n - **Issue:** #22985 \r\n\r\n\r\n- [ ] **Add tests and docs**: N/A\r\n\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\nAdditional guidelines:\r\n- Make sure optional dependencies are imported within a function.\r\n- Please do not add dependencies to pyproject.toml files (even optional\r\nones) unless they are required for unit tests.\r\n- Most PRs should not touch more than one package.\r\n- Changes should be backwards compatible.\r\n- If you are adding something to community, do not re-import it in\r\nlangchain.\r\n\r\nIf no one reviews your PR within a few days, please @-mention one of\r\nbaskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.\r\n\r\n---------\r\n\r\nSigned-off-by: Anders Swanson \r\nCo-authored-by: Chester Curme \r\n\r\n* docs: add bing search integration to agent (#22929)\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\n* core[minor]: message transformer utils (#22752)\r\n\r\n* docs[patch]: Update docs links (#23013)\r\n\r\n* docs[patch]: Adds evaluation sections (#23050)\r\n\r\nAlso want to add an index/rollup page to LangSmith docs to enable\r\nlinking to a how-to category as a group (e.g.\r\nhttps://docs.smith.langchain.com/how_to_guides/evaluation/)\r\n\r\nCC @agola11 @hinthornw\r\n\r\n* docs: Update how to docs for pydantic compatibility (#22983)\r\n\r\nAdd missing imports in docs from langchain_core.tools BaseTool\r\n\r\n---------\r\n\r\nCo-authored-by: Eugene Yurtsev \r\n\r\n* Include \"no escape\" and \"inverted section\" mustache vars in Prompt.input_variables and Prompt.input_schema (#22981)\r\n\r\n* [Community]: FIxed the DocumentDBVectorSearch `_similarity_search_without_score` (#22970)\r\n\r\n- **Description:** The PR #22777 introduced a bug in\r\n`_similarity_search_without_score` which was raising the\r\n`OperationFailure` error. The mistake was syntax error for MongoDB\r\npipeline which has been corrected now.\r\n - **Issue:** #22770\r\n\r\n* community: Fix #22975 (Add SSL Verification Option to Requests Class in langchain_community) (#22977)\r\n\r\n- **PR title**: \"community: Fix #22975 (Add SSL Verification Option to\r\nRequests Class in langchain_community)\"\r\n- **PR message**: \r\n - **Description:**\r\n- Added an optional verify parameter to the Requests class with a\r\ndefault value of True.\r\n- Modified the get, post, patch, put, and delete methods to include the\r\nverify parameter.\r\n- Updated the _arequest async context manager to include the verify\r\nparameter.\r\n- Added the verify parameter to the GenericRequestsWrapper class and\r\npassed it to the Requests class.\r\n - **Issue:** This PR fixes issue #22975.\r\n- **Dependencies:** No additional dependencies are required for this\r\nchange.\r\n - **Twitter handle:** @lunara_x\r\n\r\nYou can check this change with below code.\r\n```python\r\nfrom langchain_openai.chat_models import ChatOpenAI\r\nfrom langchain.requests import RequestsWrapper\r\nfrom langchain_community.agent_toolkits.openapi import planner\r\nfrom langchain_community.agent_toolkits.openapi.spec import reduce_openapi_spec\r\n\r\nwith open(\"swagger.yaml\") as f:\r\n data = yaml.load(f, Loader=yaml.FullLoader)\r\nswagger_api_spec = reduce_openapi_spec(data)\r\n\r\nllm = ChatOpenAI(model='gpt-4o')\r\nswagger_requests_wrapper = RequestsWrapper(verify=False) # modified point\r\nsuperset_agent = planner.create_openapi_agent(swagger_api_spec, swagger_requests_wrapper, llm, allow_dangerous_requests=True, handle_parsing_errors=True)\r\n\r\nsuperset_agent.run(\r\n \"Tell me the number and types of charts and dashboards available.\"\r\n)\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Harrison Chase \r\n\r\n* [Community]: Fixed DDG DuckDuckGoSearchResults Docstring (#22968)\r\n\r\n- **Description:** A very small fix in the Docstring of\r\n`DuckDuckGoSearchResults` identified in the following issue.\r\n- **Issue:** #22961\r\n\r\n---------\r\n\r\nCo-authored-by: Harrison Chase \r\n\r\n* docs: embeddings classes (#22927)\r\n\r\nAdded a table with all Embedding classes.\r\n\r\n* docs: Standardize DocumentLoader docstrings (#22932)\r\n\r\n**Standardizing DocumentLoader docstrings (of which there are many)**\r\n\r\nThis PR addresses issue #22866 and adds docstrings according to the\r\nissue's specified format (in the appendix) for files csv_loader.py and\r\njson_loader.py in langchain_community.document_loaders. In particular,\r\nthe following sections have been added to both CSVLoader and JSONLoader:\r\nSetup, Instantiate, Load, Async load, and Lazy load. It may be worth\r\nadding a 'Metadata' section to the JSONLoader docstring to clarify how\r\nwe want to extract the JSON metadata (using the `metadata_func`\r\nargument). The files I used to walkthrough the various sections were\r\n`example_2.json` from\r\n[HERE](https://support.oneskyapp.com/hc/en-us/articles/208047697-JSON-sample-files)\r\nand `hw_200.csv` from\r\n[HERE](https://people.sc.fsu.edu/~jburkardt/data/csv/csv.html).\r\n\r\n---------\r\n\r\nCo-authored-by: lucast2021 \r\nCo-authored-by: isaac hershenson \r\n\r\n* langchain[patch]: add tool messages formatter for tool calling agent (#22849)\r\n\r\n- **Description:** add tool_messages_formatter for tool calling agent,\r\nmake tool messages can be formatted in different ways for your LLM.\r\n - **Issue:** N/A\r\n - **Dependencies:** N/A\r\n\r\n* langchain: add id_key option to EnsembleRetriever for metadata-based document merging (#22950)\r\n\r\n**Description:**\r\n- What I changed\r\n- By specifying the `id_key` during the initialization of\r\n`EnsembleRetriever`, it is now possible to determine which documents to\r\nmerge scores for based on the value corresponding to the `id_key`\r\nelement in the metadata, instead of `page_content`. Below is an example\r\nof how to use the modified `EnsembleRetriever`:\r\n ```python\r\nretriever = EnsembleRetriever(retrievers=[ret1, ret2], id_key=\"id\") #\r\nThe Document returned by each retriever must keep the \"id\" key in its\r\nmetadata.\r\n ```\r\n\r\n- Additionally, I added a script to easily test the behavior of the\r\n`invoke` method of the modified `EnsembleRetriever`.\r\n\r\n- Why I changed\r\n- There are cases where you may want to calculate scores by treating\r\nDocuments with different `page_content` as the same when using\r\n`EnsembleRetriever`. For example, when you want to ensemble the search\r\nresults of the same document described in two different languages.\r\n- The previous `EnsembleRetriever` used `page_content` as the basis for\r\nscore aggregation, making the above usage difficult. Therefore, the\r\nscore is now calculated based on the specified key value in the\r\nDocument's metadata.\r\n\r\n**Twitter handle:** @shimajiroxyz\r\n\r\n* community: add KafkaChatMessageHistory (#22216)\r\n\r\nAdd chat history store based on Kafka.\r\n\r\nFiles added: \r\n`libs/community/langchain_community/chat_message_histories/kafka.py`\r\n`docs/docs/integrations/memory/kafka_chat_message_history.ipynb`\r\n\r\nNew issue to be created for future improvement:\r\n1. Async method implementation.\r\n2. Message retrieval based on timestamp.\r\n3. Support for other configs when connecting to cloud hosted Kafka (e.g.\r\nadd `api_key` field)\r\n4. Improve unit testing & integration testing.\r\n\r\n* LanceDB integration update (#22869)\r\n\r\nAdded : \r\n\r\n- [x] relevance search (w/wo scores)\r\n- [x] maximal marginal search\r\n- [x] image ingestion\r\n- [x] filtering support\r\n- [x] hybrid search w reranking \r\n\r\nmake test, lint_diff and format checked.\r\n\r\n* SemanticChunker : Feature Addition (\"Semantic Splitting with gradient\") (#22895)\r\n\r\n```SemanticChunker``` currently provide three methods to split the texts semantically:\r\n- percentile\r\n- standard_deviation\r\n- interquartile\r\n\r\nI propose new method ```gradient```. In this method, the gradient of distance is used to split chunks along with the percentile method (technically) . This method is useful when chunks are highly correlated with each other or specific to a domain e.g. legal or medical. The idea is to apply anomaly detection on gradient array so that the distribution become wider and easy to identify boundaries in highly semantic data.\r\nI have tested this merge on a set of 10 domain specific documents (mostly legal).\r\n\r\nDetails : \r\n - **Issue:** Improvement\r\n - **Dependencies:** NA\r\n - **Twitter handle:** [x.com/prajapat_ravi](https://x.com/prajapat_ravi)\r\n\r\n\r\n@hwchase17\r\n\r\n---------\r\n\r\nCo-authored-by: Raviraj Prajapat \r\nCo-authored-by: isaac hershenson \r\n\r\n* docs: `AWS` platform page update (#23063)\r\n\r\nAdded a reference to the `GlueCatalogLoader` new document loader.\r\n\r\n* Update Fireworks link (#23058)\r\n\r\n* docs: add trim_messages to chatbot (#23061)\r\n\r\n* LanceDB example minor change (#23069)\r\n\r\nRemoved package version `0.6.13` in the example.\r\n\r\n* core[patch],community[patch],langchain[patch]: `tenacity` dependency to version `>=8.1.0,<8.4.0` (#22973)\r\n\r\nFix https://github.com/langchain-ai/langchain/issues/22972.\r\n\r\n- [x] **PR title**: \"package: description\"\r\n- Where \"package\" is whichever of langchain, community, core,\r\nexperimental, etc. is being modified. Use \"docs: ...\" for purely docs\r\nchanges, \"templates: ...\" for template changes, \"infra: ...\" for CI\r\nchanges.\r\n - Example: \"community: add foobar LLM\"\r\n\r\n\r\n- [x] **PR message**: ***Delete this entire checklist*** and replace\r\nwith\r\n - **Description:** a description of the change\r\n - **Issue:** the issue # it fixes, if applicable\r\n - **Dependencies:** any dependencies required for this change\r\n- **Twitter handle:** if your PR gets announced, and you'd like a\r\nmention, we'll gladly shout you out!\r\n\r\n\r\n- [x] **Add tests and docs**: If you're adding a new integration, please\r\ninclude\r\n1. a test for the integration, preferably unit tests that do not rely on\r\nnetwork access,\r\n2. an example notebook showing its use. It lives in\r\n`docs/docs/integrations` directory.\r\n\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\nAdditional guidelines:\r\n- Make sure optional dependencies are imported within a function.\r\n- Please do not add dependencies to pyproject.toml files (even optional\r\nones) unless they are required for unit tests.\r\n- Most PRs should not touch more than one package.\r\n- Changes should be backwards compatible.\r\n- If you are adding something to community, do not re-import it in\r\nlangchain.\r\n\r\nIf no one reviews your PR within a few days, please @-mention one of\r\nbaskaryan, efriis, eyurtsev, ccurme, vbarda, hwchase17.\r\n\r\n* core[patch]: Document BaseStore (#23082)\r\n\r\nAdd doc-string to BaseStore\r\n\r\n* community: glob multiple patterns when using DirectoryLoader (#22852)\r\n\r\n- **Description:** Updated\r\n*community.langchain_community.document_loaders.directory.py* to enable\r\nthe use of multiple glob patterns in the `DirectoryLoader` class. Now,\r\nthe glob parameter is of type `list[str] | str` and still defaults to\r\nthe same value as before. I updated the docstring of the class to\r\nreflect this, and added a unit test to\r\n*community.tests.unit_tests.document_loaders.test_directory.py* named\r\n`test_directory_loader_glob_multiple`. This test also shows an example\r\nof how to use the new functionality.\r\n- ~~Issue:~~**Discussion Thread:**\r\nhttps://github.com/langchain-ai/langchain/discussions/18559\r\n- **Dependencies:** None\r\n- **Twitter handle:** N/a\r\n\r\n- [x] **Add tests and docs**\r\n - Added test (described above)\r\n - Updated class docstring\r\n\r\n- [x] **Lint and test**\r\n\r\n---------\r\n\r\nCo-authored-by: isaac hershenson \r\nCo-authored-by: Harrison Chase \r\nCo-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>\r\n\r\n* core[patch]: Release 0.2.9 (#23091)\r\n\r\n* community: add args_schema to SearxSearch (#22954)\r\n\r\nThis change adds args_schema (pydantic BaseModel) to SearxSearchRun for\r\ncorrect schema formatting on LLM function calls\r\n\r\nIssue: currently using SearxSearchRun with OpenAI function calling\r\nreturns the following error \"TypeError: SearxSearchRun._run() got an\r\nunexpected keyword argument '__arg1' \".\r\n\r\nThis happens because the schema sent to the LLM is \"input:\r\n'{\"__arg1\":\"foobar\"}'\" while the method should be called with the\r\n\"query\" parameter.\r\n\r\n---------\r\n\r\nCo-authored-by: Harrison Chase \r\n\r\n* core[minor]: Support multiple keys in get_from_dict_or_env (#23086)\r\n\r\nSupport passing multiple keys for ge_from_dict_or_env\r\n\r\n* community[minor]: Implement Doctran async execution (#22372)\r\n\r\n**Description**\r\n\r\nThe DoctranTextTranslator has an async transform function that was not\r\nimplemented because [the doctran\r\nlibrary](https://github.com/psychic-api/doctran) uses a sync version of\r\nthe `execute` method.\r\n\r\n- I implemented the `DoctranTextTranslator.atransform_documents()`\r\nmethod using `asyncio.to_thread` to run the function in a separate\r\nthread.\r\n- I updated the example in the Notebook with the new async version.\r\n- The performance improvements can be appreciated when a big document is\r\ndivided into multiple chunks.\r\n\r\nRelates to:\r\n- Issue #14645: https://github.com/langchain-ai/langchain/issues/14645\r\n- Issue #14437: https://github.com/langchain-ai/langchain/issues/14437\r\n- https://github.com/langchain-ai/langchain/pull/15264\r\n\r\n---------\r\n\r\nCo-authored-by: Eugene Yurtsev \r\n\r\n* docs: Fix URL formatting in deprecation warnings (#23075)\r\n\r\n**Description**\r\n\r\nUpdated the URLs in deprecation warning messages. The URLs were\r\npreviously written as raw strings and are now formatted to be clickable\r\nHTML links.\r\n\r\nExample of a broken link in the current API Reference:\r\nhttps://api.python.langchain.com/en/latest/chains/langchain.chains.openai_functions.extraction.create_extraction_chain_pydantic.html\r\n\r\n\"Screenshot\r\n\r\n* langchain[patch]: fix `OutputType` of OutputParsers and fix legacy API in OutputParsers (#19792)\r\n\r\n# Description\r\n\r\nThis pull request aims to address specific issues related to the\r\nambiguity and error-proneness of the output types of certain output\r\nparsers, as well as the absence of unit tests for some parsers. These\r\nissues could potentially lead to runtime errors or unexpected behaviors\r\ndue to type mismatches when used, causing confusion for developers and\r\nusers. Through clarifying output types, this PR seeks to improve the\r\nstability and reliability.\r\n\r\nTherefore, this pull request\r\n\r\n- fixes the `OutputType` of OutputParsers to be the expected type;\r\n- e.g. `OutputType` property of `EnumOutputParser` raises `TypeError`.\r\nThis PR introduce a logic to extract `OutputType` from its attribute.\r\n- and fixes the legacy API in OutputParsers like `LLMChain.run` to the\r\nmodern API like `LLMChain.invoke`;\r\n- Note: For `OutputFixingParser`, `RetryOutputParser` and\r\n`RetryWithErrorOutputParser`, this PR introduces `legacy` attribute with\r\nFalse as default value in order to keep the backward compatibility\r\n- and adds the tests for the `OutputFixingParser` and\r\n`RetryOutputParser`.\r\n\r\nThe following table shows my expected output and the actual output of\r\nthe `OutputType` of OutputParsers.\r\nI have used this table to fix `OutputType` of OutputParsers.\r\n\r\n| Class Name of OutputParser | My Expected `OutputType` (after this PR)|\r\nActual `OutputType` [evidence](#evidence) (before this PR)| Fix Required\r\n|\r\n|---------|--------------|---------|--------|\r\n| BooleanOutputParser | `` | `` | NO |\r\n| CombiningOutputParser | `typing.Dict[str, Any]` | `TypeError` is\r\nraised | YES |\r\n| DatetimeOutputParser | `` | `` | NO |\r\n| EnumOutputParser(enum=MyEnum) | `MyEnum` | `TypeError` is raised | YES\r\n|\r\n| OutputFixingParser | The same type as `self.parser.OutputType` | `~T`\r\n| YES |\r\n| CommaSeparatedListOutputParser | `typing.List[str]` |\r\n`typing.List[str]` | NO |\r\n| MarkdownListOutputParser | `typing.List[str]` | `typing.List[str]` |\r\nNO |\r\n| NumberedListOutputParser | `typing.List[str]` | `typing.List[str]` |\r\nNO |\r\n| JsonOutputKeyToolsParser | `typing.Any` | `typing.Any` | NO |\r\n| JsonOutputToolsParser | `typing.Any` | `typing.Any` | NO |\r\n| PydanticToolsParser | `typing.Any` | `typing.Any` | NO |\r\n| PandasDataFrameOutputParser | `typing.Dict[str, Any]` | `TypeError` is\r\nraised | YES |\r\n| PydanticOutputParser(pydantic_object=MyModel) | `` | `` | NO |\r\n| RegexParser | `typing.Dict[str, str]` | `TypeError` is raised | YES |\r\n| RegexDictParser | `typing.Dict[str, str]` | `TypeError` is raised |\r\nYES |\r\n| RetryOutputParser | The same type as `self.parser.OutputType` | `~T` |\r\nYES |\r\n| RetryWithErrorOutputParser | The same type as `self.parser.OutputType`\r\n| `~T` | YES |\r\n| StructuredOutputParser | `typing.Dict[str, Any]` | `TypeError` is\r\nraised | YES |\r\n| YamlOutputParser(pydantic_object=MyModel) | `MyModel` | `~T` | YES |\r\n\r\nNOTE: In \"Fix Required\", \"YES\" means that it is required to fix in this\r\nPR while \"NO\" means that it is not required.\r\n\r\n# Issue\r\n\r\nNo issues for this PR.\r\n\r\n# Twitter handle\r\n\r\n- [hmdev3](https://twitter.com/hmdev3)\r\n\r\n# Questions:\r\n\r\n1. Is it required to create tests for legacy APIs `LLMChain.run` in the\r\nfollowing scripts?\r\n - libs/langchain/tests/unit_tests/output_parsers/test_fix.py;\r\n - libs/langchain/tests/unit_tests/output_parsers/test_retry.py.\r\n\r\n2. Is there a more appropriate expected output type than I expect in the\r\nabove table?\r\n- e.g. the `OutputType` of `CombiningOutputParser` should be\r\nSOMETHING...\r\n\r\n# Actual outputs (before this PR)\r\n\r\n
\r\n\r\n
Actual outputs\r\n\r\n## Requirements\r\n\r\n- Python==3.9.13\r\n- langchain==0.1.13\r\n\r\n```python\r\nPython 3.9.13 (tags/v3.9.13:6de2ca5, May 17 2022, 16:36:42) [MSC v.1929 64 bit (AMD64)] on win32\r\nType \"help\", \"copyright\", \"credits\" or \"license\" for more information.\r\n>>> import langchain\r\n>>> langchain.__version__\r\n'0.1.13'\r\n>>> from langchain import output_parsers\r\n```\r\n\r\n### `BooleanOutputParser`\r\n\r\n```python\r\n>>> output_parsers.BooleanOutputParser().OutputType\r\n\r\n```\r\n\r\n### `CombiningOutputParser`\r\n\r\n```python\r\n>>> output_parsers.CombiningOutputParser(parsers=[output_parsers.DatetimeOutputParser(), output_parsers.CommaSeparatedListOutputParser()]).OutputType\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"D:\\workspace\\venv\\lib\\site-packages\\langchain_core\\output_parsers\\base.py\", line 160, in OutputType\r\n raise TypeError(\r\nTypeError: Runnable CombiningOutputParser doesn't have an inferable OutputType. Override the OutputType property to specify the output type.\r\n```\r\n\r\n### `DatetimeOutputParser`\r\n\r\n```python\r\n>>> output_parsers.DatetimeOutputParser().OutputType\r\n\r\n```\r\n\r\n### `EnumOutputParser`\r\n\r\n```python\r\n>>> from enum import Enum\r\n>>> class MyEnum(Enum):\r\n... a = 'a'\r\n... b = 'b'\r\n...\r\n>>> output_parsers.EnumOutputParser(enum=MyEnum).OutputType\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"D:\\workspace\\venv\\lib\\site-packages\\langchain_core\\output_parsers\\base.py\", line 160, in OutputType\r\n raise TypeError(\r\nTypeError: Runnable EnumOutputParser doesn't have an inferable OutputType. Override the OutputType property to specify the output type.\r\n```\r\n\r\n### `OutputFixingParser`\r\n\r\n```python\r\n>>> output_parsers.OutputFixingParser(parser=output_parsers.DatetimeOutputParser()).OutputType\r\n~T\r\n```\r\n\r\n### `CommaSeparatedListOutputParser`\r\n\r\n```python\r\n>>> output_parsers.CommaSeparatedListOutputParser().OutputType\r\ntyping.List[str]\r\n```\r\n\r\n### `MarkdownListOutputParser`\r\n\r\n```python\r\n>>> output_parsers.MarkdownListOutputParser().OutputType\r\ntyping.List[str]\r\n```\r\n\r\n### `NumberedListOutputParser`\r\n\r\n```python\r\n>>> output_parsers.NumberedListOutputParser().OutputType\r\ntyping.List[str]\r\n```\r\n\r\n### `JsonOutputKeyToolsParser`\r\n\r\n```python\r\n>>> output_parsers.JsonOutputKeyToolsParser(key_name='tool').OutputType\r\ntyping.Any\r\n```\r\n\r\n### `JsonOutputToolsParser`\r\n\r\n```python\r\n>>> output_parsers.JsonOutputToolsParser().OutputType\r\ntyping.Any\r\n```\r\n\r\n### `PydanticToolsParser`\r\n\r\n```python\r\n>>> from langchain.pydantic_v1 import BaseModel\r\n>>> class MyModel(BaseModel):\r\n... a: int\r\n...\r\n>>> output_parsers.PydanticToolsParser(tools=[MyModel, MyModel]).OutputType\r\ntyping.Any\r\n```\r\n\r\n### `PandasDataFrameOutputParser`\r\n\r\n```python\r\n>>> output_parsers.PandasDataFrameOutputParser().OutputType\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"D:\\workspace\\venv\\lib\\site-packages\\langchain_core\\output_parsers\\base.py\", line 160, in OutputType\r\n raise TypeError(\r\nTypeError: Runnable PandasDataFrameOutputParser doesn't have an inferable OutputType. Override the OutputType property to specify the output type.\r\n```\r\n\r\n### `PydanticOutputParser`\r\n\r\n```python\r\n>>> output_parsers.PydanticOutputParser(pydantic_object=MyModel).OutputType\r\n\r\n```\r\n\r\n### `RegexParser`\r\n\r\n```python\r\n>>> output_parsers.RegexParser(regex='$', output_keys=['a']).OutputType\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"D:\\workspace\\venv\\lib\\site-packages\\langchain_core\\output_parsers\\base.py\", line 160, in OutputType\r\n raise TypeError(\r\nTypeError: Runnable RegexParser doesn't have an inferable OutputType. Override the OutputType property to specify the output type.\r\n```\r\n\r\n### `RegexDictParser`\r\n\r\n```python\r\n>>> output_parsers.RegexDictParser(output_key_to_format={'a':'a'}).OutputType\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"D:\\workspace\\venv\\lib\\site-packages\\langchain_core\\output_parsers\\base.py\", line 160, in OutputType\r\n raise TypeError(\r\nTypeError: Runnable RegexDictParser doesn't have an inferable OutputType. Override the OutputType property to specify the output type.\r\n```\r\n\r\n### `RetryOutputParser`\r\n\r\n```python\r\n>>> output_parsers.RetryOutputParser(parser=output_parsers.DatetimeOutputParser()).OutputType\r\n~T\r\n```\r\n\r\n### `RetryWithErrorOutputParser`\r\n\r\n```python\r\n>>> output_parsers.RetryWithErrorOutputParser(parser=output_parsers.DatetimeOutputParser()).OutputType\r\n~T\r\n```\r\n\r\n### `StructuredOutputParser`\r\n\r\n```python\r\n>>> from langchain.output_parsers.structured import ResponseSchema\r\n>>> response_schemas = [ResponseSchema(name=\"foo\",description=\"a list of strings\",type=\"List[string]\"),ResponseSchema(name=\"bar\",description=\"a string\",type=\"string\"), ]\r\n>>> output_parsers.StructuredOutputParser.from_response_schemas(response_schemas).OutputType\r\nTraceback (most recent call last):\r\n File \"\", line 1, in \r\n File \"D:\\workspace\\venv\\lib\\site-packages\\langchain_core\\output_parsers\\base.py\", line 160, in OutputType\r\n raise TypeError(\r\nTypeError: Runnable StructuredOutputParser doesn't have an inferable OutputType. Override the OutputType property to specify the output type.\r\n```\r\n\r\n### `YamlOutputParser`\r\n\r\n```python\r\n>>> output_parsers.YamlOutputParser(pydantic_object=MyModel).OutputType\r\n~T\r\n```\r\n\r\n\r\n
\r\n\r\n---------\r\n\r\nCo-authored-by: Eugene Yurtsev \r\n\r\n* core[patch]: Pin pydantic in py3.12.4 (#23130)\r\n\r\n* core[minor]: handle boolean data in draw_mermaid (#23135)\r\n\r\nThis change should address graph rendering issues for edges with boolean\r\ndata\r\n\r\nExample from langgraph:\r\n\r\n```python\r\nfrom typing import Annotated, TypedDict\r\n\r\nfrom langchain_core.messages import AnyMessage\r\nfrom langgraph.graph import END, START, StateGraph\r\nfrom langgraph.graph.message import add_messages\r\n\r\n\r\nclass State(TypedDict):\r\n messages: Annotated[list[AnyMessage], add_messages]\r\n\r\n\r\ndef branch(state: State) -> bool:\r\n return 1 + 1 == 3\r\n\r\n\r\ngraph_builder = StateGraph(State)\r\ngraph_builder.add_node(\"foo\", lambda state: {\"messages\": [(\"ai\", \"foo\")]})\r\ngraph_builder.add_node(\"bar\", lambda state: {\"messages\": [(\"ai\", \"bar\")]})\r\n\r\ngraph_builder.add_conditional_edges(\r\n START,\r\n branch,\r\n path_map={True: \"foo\", False: \"bar\"},\r\n then=END,\r\n)\r\n\r\napp = graph_builder.compile()\r\nprint(app.get_graph().draw_mermaid())\r\n```\r\n\r\nPrevious behavior:\r\n\r\n```python\r\nAttributeError: 'bool' object has no attribute 'split'\r\n```\r\n\r\nCurrent behavior:\r\n\r\n```python\r\n%%{init: {'flowchart': {'curve': 'linear'}}}%%\r\ngraph TD;\r\n\t__start__[__start__]:::startclass;\r\n\t__end__[__end__]:::endclass;\r\n\tfoo([foo]):::otherclass;\r\n\tbar([bar]):::otherclass;\r\n\t__start__ -. ('a',) .-> foo;\r\n\tfoo --> __end__;\r\n\t__start__ -. ('b',) .-> bar;\r\n\tbar --> __end__;\r\n\tclassDef startclass fill:#ffdfba;\r\n\tclassDef endclass fill:#baffc9;\r\n\tclassDef otherclass fill:#fad7de;\r\n```\r\n\r\n* docs: use trim_messages in chatbot how to (#23139)\r\n\r\n* docs[patch]: Adds feedback input after thumbs up/down (#23141)\r\n\r\nCC @baskaryan\r\n\r\n* docs[patch]: Fix typo in feedback (#23146)\r\n\r\n* core[patch]: runnablewithchathistory from core.runnables (#23136)\r\n\r\n* openai[patch], standard-tests[patch]: don't pass in falsey stop vals (#23153)\r\n\r\nadds an image input test to standard-tests as well\r\n\r\n* anthropic: docstrings (#23145)\r\n\r\nAdded missed docstrings. Format docstrings to the consistent format\r\n(used in the API Reference)\r\n\r\n* anthropic[patch]: test image input (#23155)\r\n\r\n* text-splitters: Introduce Experimental Markdown Syntax Splitter (#22257)\r\n\r\n#### Description\r\nThis MR defines a `ExperimentalMarkdownSyntaxTextSplitter` class. The\r\nmain goal is to replicate the functionality of the original\r\n`MarkdownHeaderTextSplitter` which extracts the header stack as metadata\r\nbut with one critical difference: it keeps the whitespace of the\r\noriginal text intact.\r\n\r\nThis draft reimplements the `MarkdownHeaderTextSplitter` with a very\r\ndifferent algorithmic approach. Instead of marking up each line of the\r\ntext individually and aggregating them back together into chunks, this\r\nmethod builds each chunk sequentially and applies the metadata to each\r\nchunk. This makes the implementation simpler. However, since it's\r\ndesigned to keep white space intact its not a full drop in replacement\r\nfor the original. Since it is a radical implementation change to the\r\noriginal code and I would like to get feedback to see if this is a\r\nworthwhile replacement, should be it's own class, or is not a good idea\r\nat all.\r\n\r\nNote: I implemented the `return_each_line` parameter but I don't think\r\nit's a necessary feature. I'd prefer to remove it.\r\n\r\nThis implementation also adds the following additional features:\r\n- Splits out code blocks and includes the language in the `\"Code\"`\r\nmetadata key\r\n- Splits text on the horizontal rule `---` as well\r\n- The `headers_to_split_on` parameter is now optional - with sensible\r\ndefaults that can be overridden.\r\n\r\n#### Issue\r\nKeeping the whitespace keeps the paragraphs structure and the formatting\r\nof the code blocks intact which allows the caller much more flexibility\r\nin how they want to further split the individuals sections of the\r\nresulting documents. This addresses the issues brought up by the\r\ncommunity in the following issues:\r\n- https://github.com/langchain-ai/langchain/issues/20823\r\n- https://github.com/langchain-ai/langchain/issues/19436\r\n- https://github.com/langchain-ai/langchain/issues/22256\r\n\r\n#### Dependencies\r\nN/A\r\n\r\n#### Twitter handle\r\n@RyanElston\r\n\r\n---------\r\n\r\nCo-authored-by: isaac hershenson \r\n\r\n* ibm: docstrings (#23149)\r\n\r\nAdded missed docstrings. Format docstrings to the consistent format\r\n(used in the API Reference)\r\n\r\n* community: add **request_kwargs and expect TimeError AsyncHtmlLoader (#23068)\r\n\r\n- **Description:** add `**request_kwargs` and expect `TimeError` in\r\n`_fetch` function for AsyncHtmlLoader. This allows you to fill in the\r\nkwargs parameter when using the `load()` method of the `AsyncHtmlLoader`\r\nclass.\r\n\r\nCo-authored-by: Yucolu \r\n\r\n* docs: Overhaul Databricks components documentation (#22884)\r\n\r\n**Description:** Documentation at\r\n[integrations/llms/databricks](https://python.langchain.com/v0.2/docs/integrations/llms/databricks/)\r\nis not up-to-date and includes examples about chat model and embeddings,\r\nwhich should be located in the different corresponding subdirectories.\r\nThis PR split the page into correct scope and overhaul the contents.\r\n\r\n**Note**: This PR might be hard to review on the diffs view, please use\r\nthe following preview links for the changed pages.\r\n- `ChatDatabricks`:\r\nhttps://langchain-git-fork-b-step62-chat-databricks-doc-langchain.vercel.app/v0.2/docs/integrations/chat/databricks/\r\n- `Databricks`:\r\nhttps://langchain-git-fork-b-step62-chat-databricks-doc-langchain.vercel.app/v0.2/docs/integrations/llms/databricks/\r\n- `DatabricksEmbeddings`:\r\nhttps://langchain-git-fork-b-step62-chat-databricks-doc-langchain.vercel.app/v0.2/docs/integrations/text_embedding/databricks/\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\n---------\r\n\r\nSigned-off-by: B-Step62 \r\n\r\n* text-splitters: Fix/recursive json splitter data persistence issue (#21529)\r\n\r\nThank you for contributing to LangChain!\r\n\r\n**Description:** Noticed an issue with when I was calling\r\n`RecursiveJsonSplitter().split_json()` multiple times that I was getting\r\nweird results. I found an issue where `chunks` list in the `_json_split`\r\nmethod. If chunks is not provided when _json_split (which is the case\r\nwhen split_json calls _json_split) then the same list is used for\r\nsubsequent calls to `_json_split`.\r\n\r\n\r\nYou can see this in the test case i also added to this commit.\r\n\r\nOutput should be: \r\n```\r\n[{'a': 1, 'b': 2}]\r\n[{'c': 3, 'd': 4}]\r\n```\r\n\r\nInstead you get:\r\n```\r\n[{'a': 1, 'b': 2}]\r\n[{'a': 1, 'b': 2, 'c': 3, 'd': 4}]\r\n```\r\n\r\n---------\r\n\r\nCo-authored-by: Nuno Campos \r\nCo-authored-by: isaac hershenson \r\nCo-authored-by: Isaac Francisco <78627776+isahers1@users.noreply.github.com>\r\n\r\n* docs[patch]: Standardize prerequisites in tutorial docs (#23150)\r\n\r\nCC @baskaryan\r\n\r\n* ai21: docstrings (#23142)\r\n\r\nAdded missed docstrings. Format docstrings to the consistent format\r\n(used in the API Reference)\r\n\r\n* core[patch]: Update documentation in LLM namespace (#23138)\r\n\r\nUpdate documentation in lllm namespace.\r\n\r\n* core[patch]: Document embeddings namespace (#23132)\r\n\r\nDocument embeddings namespace\r\n\r\n* core[patch]: Expand documentation in the indexing namespace (#23134)\r\n\r\n* community: move test to integration tests (#23178)\r\n\r\nTests failing on master with\r\n\r\n> FAILED\r\ntests/unit_tests/embeddings/test_ovhcloud.py::test_ovhcloud_embed_documents\r\n- ValueError: Request failed with status code: 401, {\"message\":\"Bad\r\ntoken; invalid JSON\"}\r\n\r\n* community[patch]: Prevent unit tests from making network requests (#23180)\r\n\r\n* Prevent unit tests from making network requests\r\n\r\n* core[patch]: Add doc-string to document compressor (#23085)\r\n\r\n* core[patch]: Add documentation to load namespace (#23143)\r\n\r\nDocument some of the modules within the load namespace\r\n\r\n* core[patch]: update test to catch circular imports (#23172)\r\n\r\nThis raises ImportError due to a circular import:\r\n```python\r\nfrom langchain_core import chat_history\r\n```\r\n\r\nThis does not:\r\n```python\r\nfrom langchain_core import runnables\r\nfrom langchain_core import chat_history\r\n```\r\n\r\nHere we update `test_imports` to run each import in a separate\r\nsubprocess. Open to other ways of doing this!\r\n\r\n* core[patch]: Add an example to the Document schema doc-string (#23131)\r\n\r\nAdd an example to the document schema\r\n\r\n* core[patch]: fix chat history circular import (#23182)\r\n\r\n* fix: MoonshotChat fails when setting the moonshot_api_key through the OS environment. (#23176)\r\n\r\nClose #23174\r\n\r\nCo-authored-by: tianming \r\n\r\n* docs: add bing search tool to ms platform (#23183)\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\n* prompty: docstring (#23152)\r\n\r\nAdded missed docstrings. Format docstrings to the consistent format\r\n(used in the API Reference)\r\n\r\n---------\r\n\r\nCo-authored-by: ccurme \r\n\r\n* core[patch[: add exceptions propagation test for astream_events v2 (#23159)\r\n\r\n**Description:** `astream_events(version=\"v2\")` didn't propagate\r\nexceptions in `langchain-core<=0.2.6`, fixed in the #22916. This PR adds\r\na unit test to check that exceptions are propagated upwards.\r\n\r\nCo-authored-by: Sergey Kozlov \r\n\r\n* langchain[small]: Change type to BasePromptTemplate (#23083)\r\n\r\n```python\r\nChange from_llm(\r\n prompt: PromptTemplate \r\n ...\r\n )\r\n```\r\n to\r\n```python\r\nChange from_llm(\r\n prompt: BasePromptTemplate \r\n ...\r\n )\r\n```\r\n\r\n* community[patch]: update sambastudio embeddings (#23133)\r\n\r\nDescription: update sambastudio embeddings integration, now compatible\r\nwith generic endpoints and CoE endpoints\r\n\r\n* community[patch]: sambanova llm integration improvement (#23137)\r\n\r\n- **Description:** sambanova sambaverse integration improvement: removed\r\ninput parsing that was changing raw user input, and was making to use\r\nprocess prompt parameter as true mandatory\r\n\r\n* openai[patch]: image token counting (#23147)\r\n\r\nResolves #23000\r\n\r\n---------\r\n\r\nCo-authored-by: isaac hershenson \r\nCo-authored-by: ccurme \r\n\r\n* upstage: move to external repo (#22506)\r\n\r\n* community[patch]: restore compatibility with SQLAlchemy 1.x (#22546)\r\n\r\n- **Description:** Restores compatibility with SQLAlchemy 1.4.x that was\r\nbroken since #18992 and adds a test run for this version on CI (only for\r\nPython 3.11)\r\n- **Issue:** fixes #19681\r\n- **Dependencies:** None\r\n- **Twitter handle:** `@krassowski_m`\r\n\r\n---------\r\n\r\nCo-authored-by: Erick Friis \r\n\r\n* infra: add more formatter rules to openai (#23189)\r\n\r\nTurns on\r\nhttps://docs.astral.sh/ruff/settings/#format_docstring-code-format and\r\nhttps://docs.astral.sh/ruff/settings/#format_skip-magic-trailing-comma\r\n\r\n```toml\r\n[tool.ruff.format]\r\ndocstring-code-format = true\r\nskip-magic-trailing-comma = true\r\n```\r\n\r\n* core[patch]: Add doc-strings to outputs, fix @root_validator (#23190)\r\n\r\n- Document outputs namespace\r\n- Update a vanilla @root_validator that was missed\r\n\r\n* core[patch]: Document messages namespace (#23154)\r\n\r\n- Moved doc-strings below attribtues in TypedDicts -- seems to render\r\nbetter on APIReference pages.\r\n* Provided more description and some simple code examples\r\n\r\n* infra: run CI on large diffs (#23192)\r\n\r\ncurrently we skip CI on diffs >= 300 files. think we should just run it\r\non all packages instead\r\n\r\n---------\r\n\r\nCo-authored-by: Erick Friis \r\n\r\n* core[patch]: Document agent schema (#23194)\r\n\r\n* Document agent schema\r\n* Refer folks to langgraph for more information on how to create agents.\r\n\r\n* fireworks[patch]: fix api_key alias in Fireworks LLM (#23118)\r\n\r\nThank you for contributing to LangChain!\r\n\r\n**Description**\r\nThe current code snippet for `Fireworks` had incorrect parameters. This\r\nPR fixes those parameters.\r\n\r\n---------\r\n\r\nCo-authored-by: Chester Curme \r\nCo-authored-by: Bagatur \r\n\r\n* core:Add optional max_messages to MessagePlaceholder (#16098)\r\n\r\n- **Description:** Add optional max_messages to MessagePlaceholder\r\n- **Issue:**\r\n[16096](https://github.com/langchain-ai/langchain/issues/16096)\r\n- **Dependencies:** None\r\n- **Twitter handle:** @davedecaprio\r\n\r\nSometimes it's better to limit the history in the prompt itself rather\r\nthan the memory. This is needed if you want different prompts in the\r\nchain to have different history lengths.\r\n\r\n---------\r\n\r\nCo-authored-by: Harrison Chase \r\n\r\n* docs: standard params (#23199)\r\n\r\n* standard-tests[patch]: test stop not stop_sequences (#23200)\r\n\r\n* fix https://github.com/langchain-ai/langchain/issues/23215 (#23216)\r\n\r\nfix bug \r\nThe ZhipuAIEmbeddings class is not working.\r\n\r\nCo-authored-by: xu yandong \r\n\r\n* huggingface[patch]: fix CI for python 3.12 (#23197)\r\n\r\n* huggingface: docstrings (#23148)\r\n\r\nAdded missed docstrings. Format docstrings to the consistent format\r\n(used in the API Reference)\r\n\r\nCo-authored-by: ccurme \r\n\r\n* Docs: Update Rag tutorial so it includes an additional notebook cell with pip installs of required langchain_chroma and langchain_community. (#23204)\r\n\r\nDescription: Update Rag tutorial notebook so it includes an additional\r\nnotebook cell with pip installs of required langchain_chroma and\r\nlangchain_community.\r\n\r\nThis fixes the issue with the rag tutorial gives you a 'missing modules'\r\nerror if you run code in the notebook as is.\r\n\r\n---------\r\n\r\nCo-authored-by: Chester Curme \r\n\r\n* doc: replace function all with tool call (#23184)\r\n\r\n- [x] **Lint and test**: Run `make format`, `make lint` and `make test`\r\nfrom the root of the package(s) you've modified. See contribution\r\nguidelines for more: https://python.langchain.com/docs/contributing/\r\n\r\n* partners[minor]: Fix value error message for with_structured_output (#22877)\r\n\r\nCurrently, calling `with_structured_output()` with an invalid method\r\nargument raises `Unrecognized method argument. Expected one of\r\n'function_calling' or 'json_format'`, but the JSON mode option [is now\r\nreferred\r\nto](https://python.langchain.com/v0.2/docs/how_to/structured_output/#the-with_structured_output-method)\r\nby `'json_mode'`. This fixes that.\r\n\r\nCo-authored-by: Harrison Chase \r\n\r\n* community: docstrings (#23202)\r\n\r\nAdded missed docstrings. Format docstrings to the consistent format\r\n(used in the API Reference)\r\n\r\n* docs: Update clean up API reference (#23221)\r\n\r\n- Fix bug with TypedDicts rendering inherited methods if inherting from\r\n typing_extensions.TypedDict rather than typing.TypedDict\r\n- Do not surface inherited pydantic methods for subclasses of BaseModel\r\n- Subclasses of RunnableSerializable will not how methods inherited from\r\n Runnable or from BaseModel\r\n- Subclasses of Runnable that not pydantic models will include a link to\r\nRunnableInterface (they still show inherited methods, we can fix this\r\nlater)\r\n\r\n* docs: API reference remove Prev/Up/Next buttons (#23225)\r\n\r\nThese do not work anyway. Let's remove them for now for simplicity.\r\n\r\n* core[minor]: Adds an in-memory implementation of RecordM…","shortMessageHtmlLink":"Merge langchain==0.2.6 to skypoint-langchain (#14)"}},{"before":"835cc31cccb4823e538d6081552341fa15b1ef59","after":"508cdcc1933cc535c3b3c44a7336977b6758ea3b","ref":"refs/heads/users/arunraja/skypoint-langchain-0.2.0","pushedAt":"2024-06-27T06:19:51.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Bump version to 0.2.11dev1 for langchain-community, langchain-core, and langchain","shortMessageHtmlLink":"Bump version to 0.2.11dev1 for langchain-community, langchain-core, a…"}},{"before":"509bb723d11d81c7a6a27b2a19983ec31327cd31","after":"835cc31cccb4823e538d6081552341fa15b1ef59","ref":"refs/heads/users/arunraja/skypoint-langchain-0.2.0","pushedAt":"2024-06-27T05:19:16.000Z","pushType":"push","commitsCount":678,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Resolved conflicts by taking current branch changes","shortMessageHtmlLink":"Resolved conflicts by taking current branch changes"}},{"before":"d3515607dbb4e2bc919cb2ab1f3452252dbbf21b","after":"509bb723d11d81c7a6a27b2a19983ec31327cd31","ref":"refs/heads/users/arunraja/skypoint-langchain-0.2.0","pushedAt":"2024-06-27T05:06:31.000Z","pushType":"push","commitsCount":12,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Merge branch 'main' of https://github.com/skypointcloud/skypoint-langchain into users/arunraja/skypoint-langchain-0.2.0","shortMessageHtmlLink":"Merge branch 'main' of https://github.com/skypointcloud/skypoint-lang…"}},{"before":"e5046cbd7226d7043535f87dd40973d83879786f","after":"d3515607dbb4e2bc919cb2ab1f3452252dbbf21b","ref":"refs/heads/users/arunraja/skypoint-langchain-0.2.0","pushedAt":"2024-06-27T04:43:26.000Z","pushType":"push","commitsCount":5,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Bump version to 0.2.4dev1 for langchain-community, langchain-core, and langchain","shortMessageHtmlLink":"Bump version to 0.2.4dev1 for langchain-community, langchain-core, an…"}},{"before":null,"after":"e5046cbd7226d7043535f87dd40973d83879786f","ref":"refs/heads/users/arunraja/skypoint-langchain-0.2.0","pushedAt":"2024-06-25T05:47:43.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"langchain: release 0.2.0, fix min deps (#21833)","shortMessageHtmlLink":"langchain: release 0.2.0, fix min deps (langchain-ai#21833)"}},{"before":"481ca30afeaa1edb0860a709f4ea50796461afbe","after":"eb0adef3e9ddc2ed434bfabfb1df872b9a2eccc4","ref":"refs/heads/main","pushedAt":"2024-06-24T06:13:11.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"SherLoQ support added (#9)\n\n* querycreatortool added\r\n\r\n* sqlquerycreatortool added\r\n\r\n* Update version and add SQLCoderToolkit\r\n\r\n* Updated tool.py for sqlcoder\r\n\r\n* retry logic added in sqlquerycreator tool\r\n\r\n* sql query capture updated\r\n\r\n* version update\r\n\r\n* langchain version update\r\n\r\n* merge fix\r\n\r\n* version change to accomodate 36dev1(uncommited code to fix unstructered query for genesis by arunRaja)\r\n\r\n* add changes to sqlcoder prompt\r\n\r\n* version update\r\n\r\n* added structured decomposition😁 to sherloq\r\n\r\n* sqlcoder prompt updated\r\n\r\n* prompt updated sqlcoder\r\n\r\n* Add CustomPlanandSolveExecutor class to agent.py\r\n\r\n* Update langchain version to 0.1.46dev1\r\n\r\n* query mixing fixed\r\n\r\n* version updated\r\n\r\n* chore: Add sources to agent state\r\n\r\n* sqlcoder retry prompt updated\r\n\r\n* version updated\r\n\r\n* changes added\r\n\r\n* retry mechanism bug fix\r\n\r\n* SQL_QUERY_CREATOR_TEMPLATE is removed from langchain\r\n\r\n* changes to sqlcodertoolkit\r\n\r\n* changes to sqlcodertoolkit\r\n\r\n* changes to sqlcodertoolkit\r\n\r\n* Add prompt instructions to include sources in the document variable\r\n\r\n* Update document variable to include relevant sources\r\n\r\n* Update document variable to include relevant sources\r\n\r\n* Update sources handling in BaseQAWithSourcesChain\r\n\r\n* Update SQL query creator tool to remove unnecessary code and improve readability\r\n\r\n---------\r\n\r\nCo-authored-by: sushant \r\nCo-authored-by: arunraja1 \r\nCo-authored-by: Sushant Burnawal ","shortMessageHtmlLink":"SherLoQ support added (#9)"}},{"before":"e2737c3344ef3bf04072732e9abc6e0c9daddb29","after":"09d5c0cf7f863e4a75ccca7432ae37b4bc70c88a","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-06-21T13:50:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Update SQL query creator tool to remove unnecessary code and improve readability","shortMessageHtmlLink":"Update SQL query creator tool to remove unnecessary code and improve …"}},{"before":"cf50a6c2dc50558c3f9aaa22a04136cec3e59998","after":"e2737c3344ef3bf04072732e9abc6e0c9daddb29","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-30T03:46:24.000Z","pushType":"push","commitsCount":3,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Update sources handling in BaseQAWithSourcesChain","shortMessageHtmlLink":"Update sources handling in BaseQAWithSourcesChain"}},{"before":"4f611ba7e3a5509b5feeae1116b830a83891dbe9","after":"cf50a6c2dc50558c3f9aaa22a04136cec3e59998","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-30T03:04:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Add prompt instructions to include sources in the document variable","shortMessageHtmlLink":"Add prompt instructions to include sources in the document variable"}},{"before":"e2b0246e7cb6049ac4f3e8a043b5d595a31dfe78","after":"4f611ba7e3a5509b5feeae1116b830a83891dbe9","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-24T10:56:47.000Z","pushType":"push","commitsCount":3,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"changes to sqlcodertoolkit","shortMessageHtmlLink":"changes to sqlcodertoolkit"}},{"before":"9db1f3500026af8b6608f086b0f079ec4534ece0","after":"e2b0246e7cb6049ac4f3e8a043b5d595a31dfe78","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-24T09:09:56.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"SQL_QUERY_CREATOR_TEMPLATE is removed from langchain","shortMessageHtmlLink":"SQL_QUERY_CREATOR_TEMPLATE is removed from langchain"}},{"before":"a8027442a7cc02af55738d83734ef11ab6553dfa","after":"9db1f3500026af8b6608f086b0f079ec4534ece0","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-22T06:18:37.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"retry mechanism bug fix","shortMessageHtmlLink":"retry mechanism bug fix"}},{"before":"ee19e78419321aacefd585aa02a90055b529eead","after":"a8027442a7cc02af55738d83734ef11ab6553dfa","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-08T09:29:18.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"changes added","shortMessageHtmlLink":"changes added"}},{"before":"78f3ed51ad0348fc247589165f5936a690ffd272","after":"ee19e78419321aacefd585aa02a90055b529eead","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-08T01:22:10.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Merge branch 'users/sushant/sherloq' of https://github.com/skypointcloud/skypoint-langchain into users/sushant/sherloq","shortMessageHtmlLink":"Merge branch 'users/sushant/sherloq' of https://github.com/skypointcl…"}},{"before":"1c22b3d813d0a758af95893285fdc2501243cf95","after":"78f3ed51ad0348fc247589165f5936a690ffd272","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-07T15:55:04.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"version updated","shortMessageHtmlLink":"version updated"}},{"before":"7e3da7ff435b0d2c0414a2f506d286020d4da7e6","after":"1c22b3d813d0a758af95893285fdc2501243cf95","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-07T15:54:06.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"sqlcoder retry prompt updated","shortMessageHtmlLink":"sqlcoder retry prompt updated"}},{"before":"868474cf90a7c8c1fdce6ab7a5fd36f91b281a93","after":"7e3da7ff435b0d2c0414a2f506d286020d4da7e6","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-06T12:47:29.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"version updated","shortMessageHtmlLink":"version updated"}},{"before":"14a50ad723e375602bbb0decafcf008d81568429","after":"868474cf90a7c8c1fdce6ab7a5fd36f91b281a93","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-06T12:45:51.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"query mixing fixed","shortMessageHtmlLink":"query mixing fixed"}},{"before":"f145added6f13631bdd843747ca34977ffbea273","after":"14a50ad723e375602bbb0decafcf008d81568429","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-05-05T04:41:25.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"arunraja1","name":"Arunraja D","path":"/arunraja1","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/103998125?s=80&v=4"},"commit":{"message":"Update langchain version to 0.1.46dev1","shortMessageHtmlLink":"Update langchain version to 0.1.46dev1"}},{"before":"20d3f78c04f768bd642f3be3ad3f8b24046c28a8","after":"f145added6f13631bdd843747ca34977ffbea273","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-04-15T10:38:44.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"prompt updated sqlcoder","shortMessageHtmlLink":"prompt updated sqlcoder"}},{"before":"099962abfcdfb8a3408746596ceb8684879b4107","after":"20d3f78c04f768bd642f3be3ad3f8b24046c28a8","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-04-04T13:18:28.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"sqlcoder prompt updated","shortMessageHtmlLink":"sqlcoder prompt updated"}},{"before":"39ec7f77782062959719bf8eee66b99ded9b6bdc","after":"099962abfcdfb8a3408746596ceb8684879b4107","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-04-04T04:24:32.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"added structured decomposition😁 to sherloq","shortMessageHtmlLink":"added structured decomposition😁 to sherloq"}},{"before":"a19033242aa44d0b9a92ffcf73d686523d154ff5","after":"39ec7f77782062959719bf8eee66b99ded9b6bdc","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-04-03T08:18:14.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"version update","shortMessageHtmlLink":"version update"}},{"before":"13cdeef10b845f495f48d589699b53da5e949806","after":"a19033242aa44d0b9a92ffcf73d686523d154ff5","ref":"refs/heads/users/sushant/sherloq","pushedAt":"2024-04-03T08:16:35.000Z","pushType":"push","commitsCount":3,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"Merge branch 'main' into users/sushant/sherloq","shortMessageHtmlLink":"Merge branch 'main' into users/sushant/sherloq"}},{"before":"29c1f6025571279459b850bdc27d89da81c02059","after":"481ca30afeaa1edb0860a709f4ea50796461afbe","ref":"refs/heads/main","pushedAt":"2024-04-03T08:12:07.000Z","pushType":"pr_merge","commitsCount":1,"pusher":{"login":"sushantburnawal","name":"Sushant Shekhar Burnawal","path":"/sushantburnawal","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/41643862?s=80&v=4"},"commit":{"message":"Update langchain version to 0.1.41dev1 (#13)","shortMessageHtmlLink":"Update langchain version to 0.1.41dev1 (#13)"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAErLb38gA","startCursor":null,"endCursor":null}},"title":"Activity · skypointcloud/skypoint-langchain"}