Skip to main content

langchain-upstage

This package contains the LangChain integrations for Upstage through their APIs.

Installation and Setup

  • Install the LangChain partner package
pip install -U langchain-upstage
  • Get an Upstage api key from Upstage Console and set it as an environment variable (UPSTAGE_API_KEY)

Chat Models

This package contains the ChatUpstage class, which is the recommended way to interface with Upstage models.

See a usage example

Embeddings

See a usage example

Use solar-embedding-1-large model for embeddings. Do not add suffixes such as -query or -passage to the model name. UpstageEmbeddings will automatically add the suffixes based on the method called.

Document Parse Loader

See a usage example

The use_ocr option determines whether OCR will be used for text extraction from documents. If this option is not specified, the default policy of the Upstage Document Parse API service will be applied. When use_ocr is set to True, OCR is utilized to extract text. In the case of PDF documents, this involves converting the PDF into images before performing OCR. Conversely, if use_ocr is set to False for PDF documents, the text information embedded within the PDF is used directly. However, if the input document is not a PDF, such as an image, setting use_ocr to False will result in an error.

from langchain_upstage import UpstageDocumentParseLoader

file_path = "/PATH/TO/YOUR/FILE.image"
layzer = UpstageDocumentParseLoader(file_path, split="page")

# For improved memory efficiency, consider using the lazy_load method to load documents page by page.
docs = layzer.load()  # or layzer.lazy_load()

for doc in docs[:3]:
    print(doc)

If you are a Windows user, please ensure that the Visual C++ Redistributable is installed before using the loader.

Metadata

Release files for langchain-upstage 0.7.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for langchain-upstage 0.7.7
File Size Uploaded
langchain_upstage-0.7.7.tar.gz 21.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for langchain-upstage 0.7.7
File Interpreter ABI Platform
langchain_upstage-0.7.7-py3-none-any.whl Python 3 none any Details

Total release size: 47.7 kB

Release files / langchain_upstage-0.7.7.tar.gz

Download URL langchain_upstage-0.7.7.tar.gz
Size 21.1 kB
Tags Source
SHA-256 checksum
How to use checksums
7e6d34b0b58c9a7ce7e1ae8997f841491de6b2b9766619c99dca10ccbbd04bcb
BLAKE2b-256 checksum
How to use checksums
f7de4769f96de2b686134e9d1d2069967bc1213c7c0ae4cbd2261366f0094617
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / langchain_upstage-0.7.7-py3-none-any.whl

Download URL langchain_upstage-0.7.7-py3-none-any.whl
Size 26.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
493e2fcf78bf9133b0336d1426d4767a6baf90ed43ca500f0cdb262b56243ce5
BLAKE2b-256 checksum
How to use checksums
e3d6601b818561ba4ce12773b3b2ce984c7769687d566850834b0156649f650d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page