Skip to main content

An integration package connecting Prompty and LangChain

Project description

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}}

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_prompty-0.0.3.tar.gz (9.5 kB view details)

Uploaded Source

Built Distribution

langchain_prompty-0.0.3-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file langchain_prompty-0.0.3.tar.gz.

File metadata

  • Download URL: langchain_prompty-0.0.3.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.0 CPython/3.12.5

File hashes

Hashes for langchain_prompty-0.0.3.tar.gz
Algorithm Hash digest
SHA256 fabcda0097d1408ddc46579f35f02a02251f8393db3191d343bf66cbc5d09367
MD5 6428c120fe41d468dd5d408ef2237f49
BLAKE2b-256 5ce0472311fc18dc4b38b64c1c64f2b83d0ae38a5fe77e30bdd35bc4dda4555d

See more details on using hashes here.

File details

Details for the file langchain_prompty-0.0.3-py3-none-any.whl.

File metadata

File hashes

Hashes for langchain_prompty-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 38f2fb04663c1f41924dacebca4dc1002af45055a6b7711c69280d0274b173d2
MD5 ad8c49503940d517a55eb721360b7e5d
BLAKE2b-256 82a3bdb6351c67687e3c11a246b71ab088f2f7cb56b7c9ddb7ecf1c9132a5718

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