You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
langchain/libs/partners/prompty
Leonid Ganeline 50484be330
prompty: docstring (#23152)
Added missed docstrings. Format docstrings to the consistent format
(used in the API Reference)

---------

Co-authored-by: ccurme <chester.curme@gmail.com>
3 months ago
..
langchain_prompty prompty: docstring (#23152) 3 months ago
scripts prompty: adding Microsoft langchain_prompty package (#21346) 4 months ago
tests docs: fix some spelling mistakes caught by newest version of code spell (#22090) 4 months ago
.gitignore prompty: adding Microsoft langchain_prompty package (#21346) 4 months ago
LICENSE prompty: adding Microsoft langchain_prompty package (#21346) 4 months ago
Makefile prompty: adding Microsoft langchain_prompty package (#21346) 4 months ago
README.md prompty: adding Microsoft langchain_prompty package (#21346) 4 months ago
poetry.lock prompty: docstring (#23152) 3 months ago
pyproject.toml multiple: releases with relaxed core dep (#21724) 4 months ago

README.md

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