Skip to content

Persistence Bug Related to add_example #16

@cory-orennia

Description

@cory-orennia

There is a bug somewhere causing examples to persist outside of a function that uses them. This causes the examples to be duplicated indefinitely until the Python kernal is restarted. Example...

def prompt_bug():
    
    config = PromptEngineConfig(ModelConfig(max_tokens=500))
    description = 'description'
    prompt_engine = PromptEngine(config=config, description=description)
    
    prompt_engine.add_example('Input A', 'Output A')
    prompt_engine.add_example('Input B', 'Output B')

    prompt = prompt_engine.build_prompt('Query')
    
    print(prompt)
    
    return None

This function, when run the first time produces the desired results...

image

But when run again (and again up to the point the python kernal is restarted) will generate duplicate examples...

image

Run a third time...

image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions