Skip to main content

An integration package connecting Volcengine ARK and LangChain

Project description

langchain-ark

Welcome to Volcengine Ark

website

Installation and Setup

Install the integration package:

pip install langchain-ark


Request an API key and set it as an environment variable

export ARK_API_KEY=...
export ARK_MODEL_ENDPOINT_ID=ep-...

ChatModel Example:

import os
from langchain_ark.chat_models import ChatArk
from langchain_core.prompts import PromptTemplate
from langchain_core.output_parsers import StrOutputParser

prompt_template = PromptTemplate.from_template("Hello {role}")
llm = ChatArk(model=os.environ["ARK_MODEL_ENDPOINT_ID"])
parser = StrOutputParser()
chain = prompt_template | llm | parser
print(chain.invoke({"role": "Doubao"}))

Embeddings Example:

from langchain_ark.embeddings import ArkEmbeddings

ArkEmbeddings().embed_query("Volcengine ARK Doubao")

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

langchain_ark-0.1.4.tar.gz (13.3 kB view details)

Uploaded Source

Built Distribution

langchain_ark-0.1.4-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

File details

Details for the file langchain_ark-0.1.4.tar.gz.

File metadata

  • Download URL: langchain_ark-0.1.4.tar.gz
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/23.4.0

File hashes

Hashes for langchain_ark-0.1.4.tar.gz
Algorithm Hash digest
SHA256 3d0478267ed3efc078503aad7d50f3a6fa7e09a40c02a0e3907986b5fdcf2ba4
MD5 2155aa75b5272a04976ac6c769c393e9
BLAKE2b-256 72a43822673e663163f89628580a3f09f949896e136fa7e7086b0899dbf8b17d

See more details on using hashes here.

File details

Details for the file langchain_ark-0.1.4-py3-none-any.whl.

File metadata

  • Download URL: langchain_ark-0.1.4-py3-none-any.whl
  • Upload date:
  • Size: 14.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.3 CPython/3.11.10 Darwin/23.4.0

File hashes

Hashes for langchain_ark-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 1649e7ff28749b2831841c4568c19fd37062a4bf557c854fa3843c9e730047d2
MD5 64ed28e131a9e624f09831435ce03e05
BLAKE2b-256 df0acbb302105d44e5a8d73696736904e6faefb5750e87df37631374a8f6fc64

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page