Skip to main content

LangChain integration library for AOps

Project description

aops

LangChain integration library for AOps — load and version-control your agent prompts from the AOps backend.

Installation

pip install aops

Quick Start

import aops
from aops.langchain import pull
from langchain_core.prompts import ChatPromptTemplate, HumanMessagePromptTemplate
from langchain_core.output_parsers import StrOutputParser
from langchain_openai import ChatOpenAI

aops.init(api_key="aops_...")

prompt = pull("my-agent/my-chain")

chain = (
    ChatPromptTemplate.from_messages([
        prompt,
        HumanMessagePromptTemplate.from_template("{user_input}"),
    ])
    | ChatOpenAI(model="gpt-4o-mini")
    | StrOutputParser()
)

result = chain.invoke({"user_input": "Hello!"})

Requirements

  • Python 3.12+
  • AOps backend running (self-hosted)
  • API key issued from the AOps UI: Agent detail page → API Keys → New API Key

Docs

License

MIT

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

aops-0.2.0.tar.gz (9.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

aops-0.2.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file aops-0.2.0.tar.gz.

File metadata

  • Download URL: aops-0.2.0.tar.gz
  • Upload date:
  • Size: 9.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for aops-0.2.0.tar.gz
Algorithm Hash digest
SHA256 ad6dd8b3faea0e52adfb0ad85475a69b9609c865c41b41c7d6df3ea3b0661a24
MD5 60172853f8f15391c91a622d6ee92807
BLAKE2b-256 d3e406e5a99259113a51103424762ff44e27cc7fca62b2505a21027a2aab1566

See more details on using hashes here.

File details

Details for the file aops-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: aops-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.10

File hashes

Hashes for aops-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7f3537ff8b3942c54cff73d9e3dfcfda803571fe03487d9466eacdf17c0f4b74
MD5 39b1fae4aa4a369f03ea3845d5150210
BLAKE2b-256 04e4378986efc0d0bb87bb06196be764dd89471e79d1b07db773f27cb449db0f

See more details on using hashes here.

Supported by

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