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

Prompt not properly versioned when in a class #404

Open
brenorb opened this issue Dec 13, 2024 · 3 comments
Open

Prompt not properly versioned when in a class #404

brenorb opened this issue Dec 13, 2024 · 3 comments

Comments

@brenorb
Copy link
Contributor

brenorb commented Dec 13, 2024

To organize better the code, I created an Agent class where I can run a simple step or run an infinite loop to talk with it, as well as get important information in between.
However, it seems that it won't version the prompt anymore. When looking in Studio, I only get a <BmV> tag with self = <Agent object>. It seems only the tools are versioned now. The code below is what I get when I look there.

from types import GenericAlias
from typing import _GenericAlias
import ell

# <BmV>
self = <Agent object>
# </BmV>

# <BV>
DEBUG = True
# </BV>

def mock_generate_qr_code(amount: int = None) -> Dict[str, Union[int, str]]:
    """Generate a QR code"""
    if amount <= 0 or amount is None:
        return {
            "status": 200,
            "message": "qr code generated",
            "tool": "generate_qr_code",
        }
    else:
        print(f"Mock generating qr code with {amount}")
        return {
            "status": 200,
            "message": f"qr code generated successfully with {amount}",
            "tool": "generate_qr_code",
        }

@ell.tool()
def generate_qr_code(amount: int = None):
    """Generate a QR code"""
    if DEBUG:
        return mock_generate_qr_code(amount=amount)
    else:
        # Real API call here
        raise NotImplementedError("Real API call not implemented")

@MadcowD
Copy link
Owner

MadcowD commented Dec 16, 2024

Oh interesting! I'll take a look :)

@MadcowD
Copy link
Owner

MadcowD commented Dec 16, 2024

Can you give me a minimal example i can reproduce with?

@brenorb
Copy link
Contributor Author

brenorb commented Dec 21, 2024

Sure, here it is: https://gist.github.com/brenorb/e0e5f06422415b82be93e1a7cfe79a1b

It doesn't show the system prompt.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants