MagnivOrg / prompt-layer-library

🍰 PromptLayer - Maintain a log of your prompts and OpenAI API requests. Track, debug, and replay old completions.
https://www.promptlayer.com
Apache License 2.0
479 stars 42 forks source link

Fixed `to_prompt` method in case output_parser unavailable #53

Closed ainomic-dev closed 11 months ago

ainomic-dev commented 11 months ago

Issue:

prompt_template = promptlayer.prompts.get("test_template", langchain=True)
print(prompt_template)

The above prints the following output:

'output_parser'
None

The expected output is of type ChatPromptTemplate. It prints above output because of a bug in the code of to_prompt method. I've fixed the bug and submitting this PR to review and receive feedback.

System Details

Version: 0.1.93 Python: 3.10.12 Langchain: 0.0.247