Skip to content
New issue

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

Automatically version and trace llm.call methods with lilypad.configure #921

Closed
willbakst opened this issue Mar 18, 2025 — with Linear · 1 comment
Closed

Automatically version and trace llm.call methods with lilypad.configure #921

willbakst opened this issue Mar 18, 2025 — with Linear · 1 comment
Assignees
Labels

Comments

Copy link
Contributor

We should make the following code snippet just work:

from mirascope import lilypad, llm

lilypad.configure()

@llm.call("openai", "gpt-4o-mini")
def recommend_book(genre: str) -> str:
    return f"Recommend a {genre} book"

response = recommend_book("fantasy")  # automatically versioned and traced
print(response.content)

The result should be the same as if using the lilypad.generation decorator except without it. This means the resulting closure we compute would be:

from mirascope import llm

@llm.call("openai", "gpt-4o-mini")
def recommend_book(genre: str) -> str:
    return f"Recommend a {genre} book"

We should also ensure that using lilypad.generation would still work, e.g.

from mirascope import lilypad, llm

@lilypad.generation()
@llm.call("openai", "gpt-4o-mini")
def recommend_book(genre: str) -> str:
    return f"Recommend a {genre} book"

Of course, this would include @lilypad.generation() in the computed closure unlike the first example where it's excluded.

We should keep this functionality in the lilypad branch until we're ready to release it.

@willbakst willbakst added the enhancement New feature or request label Mar 18, 2025
@willbakst
Copy link
Contributor Author

This will be further designed and implemented as part of Mirascope 2.0

For now I will close this issue and open a new issue in the future with more details when I have them.

@willbakst willbakst closed this as not planned Won't fix, can't repro, duplicate, stale Mar 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants