We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
prompt_template
Run the following code:
import logfire from dotenv import load_dotenv from mirascope.core import openai, prompt_template from mirascope.integrations.logfire import with_logfire load_dotenv() logfire.configure() @with_logfire() @openai.call(model="gpt-4o-mini") def recommend_book_bad(genre: str) -> str: return f"Recommend a {genre} book" @with_logfire() @openai.call(model="gpt-4o-mini") @prompt_template("Recommend a {genre} book") def recommend_book_good(genre: str): ... print(recommend_book_bad("fantasy")) # ugly log print(recommend_book_good("fantasy")) # pretty log
And you will see the following ugly log on logfire:
This one is prettier log:
The only difference between them is the existence of prompt_template decorator in the 2nd function.
How can we make the log pretty for the 1st function as well? I like to write in style of first function more because is more explicit and less magic.
Sorry @willbakst, lots of bug reports lately.
mirascope==1.15.1
The text was updated successfully, but these errors were encountered:
fix: #775
c5f4777
Fix released in v1.16.1!
v1.16.1
Sorry, something went wrong.
willbakst
Successfully merging a pull request may close this issue.
Description
Run the following code:
And you will see the following ugly log on logfire:
This one is prettier log:
The only difference between them is the existence of
prompt_template
decorator in the 2nd function.How can we make the log pretty for the 1st function as well?
I like to write in style of first function more because is more explicit and less magic.
Sorry @willbakst, lots of bug reports lately.
Python, Mirascope & OS Versions, related packages (not required)
The text was updated successfully, but these errors were encountered: