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

Expose instructions getter in realtime session? #1223

Open
willsmanley opened this issue Dec 13, 2024 · 0 comments
Open

Expose instructions getter in realtime session? #1223

willsmanley opened this issue Dec 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@willsmanley
Copy link
Contributor

willsmanley commented Dec 13, 2024

I have a pattern where I update system prompt / instructions dynamically during the course of a conversation with realtime agent.

I'd like to do a simple check to compare updated instructions with existing instructions, however its private behind _opts.

Since instructions is initially a consumer-facing property during initialization, maybe it should be accessible afterwards with a public getter?

This is a pretty minor thing, I can always have a duplicate copy on my application side, but it adds some duplicative memory footprint when the prompt is particularly long.

However could be a simple change in realtime.py like this:

class RealtimeSession(utils.EventEmitter[EventTypes]):
    @property
    def instructions(self) -> str:
        return self._opts.instructions

Sorry for bug label, it won't let me create an issue any other way.

@willsmanley willsmanley added the bug Something isn't working label Dec 13, 2024
@willsmanley willsmanley changed the title Expose instructions getter in realtime agent? Expose instructions getter in realtime session? Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant