Skip to content

Rev-x/Reflexion-Implementation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

Reflexion Pipeline

This project implements the Reflexion Pipeline from the paper Reflexion , which allows for iterative task refinement and evaluation. this file can be used as a module in your own Directories just clone the repo and use the file path as a module(better keep this file in your directory where you are trying to import it) still a work in progress a lot of optimizations and work is in progress Feel free to suggest ideas/thoughts.

Usage

Here's a basic example of how to use the Reflexion Pipeline:

python
Copy
from reflexion import ReflexionPipeline # Initialize the pipeline with a model name reflexion = ReflexionPipeline(model_name) # Define your task task ="" # Run the reflexion loop final_task, final_output, final_evaluation = reflexion.reflexion_loop(task, max_iterations=5, criteria=0.9)

Parameters

  • model_name: The name of the model to use for the Reflexion Pipeline.<br>
  • task: The initial task or prompt to refine and evaluate.<br>
  • max_iterations: The maximum number of iterations for the reflexion loop (default is 5).<br>
  • criteria: The exit criteria score (between 0 and 1) at which the loop will stop if reached before max_iterations (default is 0.9).

Customization

You can customize the Reflexion Pipeline by adjusting the following parameters:

  • max_iterations: Set this to the number of reflexion iterations you want to perform.<br>
  • criteria: Adjust this value to change the satisfactory score at which the loop will exit early.

Output

The reflexion_loop method returns three values:

  1. final_task: The refined task after iterations.<br>
  2. final_output: The final output generated for the task.<br>
  3. final_evaluation: The evaluation score for the final output.

Note

Make sure to define your task variable with an appropriate prompt or task description before running the reflexion loop.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •  

Languages