langchain/libs/partners/prompty
Mason Daugherty e7eac27241
ruff: more rules across the board & fixes (#31898)
* standardizes ruff dep version across all `pyproject.toml` files
* cli: ruff rules and corrections
* langchain: rules and corrections
2025-07-07 17:48:01 -04:00
..
langchain_prompty langchain-prompty[patch]: Add ruff bandit rules to linter (#31814) 2025-07-01 18:32:02 +00:00
scripts partners: bug fix check_imports.py exit code. (#30897) 2025-04-17 08:02:23 -04:00
tests partners[lint]: run pyupgrade to get code in line with 3.9 standards (#30781) 2025-04-11 07:18:44 -04:00
.gitignore
LICENSE
Makefile fix: automatically fix issues with ruff (#31897) 2025-07-07 14:13:10 -04:00
pyproject.toml ruff: more rules across the board & fixes (#31898) 2025-07-07 17:48:01 -04:00
README.md
uv.lock packaging: remove Python upper bound for langchain and co libs (#31025) 2025-04-28 14:44:28 -04:00

langchain-prompty

This package contains the LangChain integration with Microsoft Prompty.

Installation

pip install -U langchain-prompty

Usage

Use the create_chat_prompt function to load prompty file as prompt.

from langchain_prompty import create_chat_prompt

prompt = create_chat_prompt('<your .prompty file path>')

Then you can use the prompt for next steps.

Here is an example .prompty file:

---
name: Basic Prompt
description: A basic prompt that uses the GPT-3 chat API to answer questions
authors:
  - author_1
  - author_2
model:
  api: chat
  configuration:
    azure_deployment: gpt-35-turbo
sample:
  firstName: Jane
  lastName: Doe
  question: What is the meaning of life?
  chat_history: []
---
system:
You are an AI assistant who helps people find information.
As the assistant, you answer questions briefly, succinctly, 
and in a personable manner using markdown and even add some personal flair with appropriate emojis.

{% for item in chat_history %}
{{item.role}}:
{{item.content}}
{% endfor %}


user:
{{input}}