Skip to content

Commit

Permalink
Toggle memory support (#2)
Browse files Browse the repository at this point in the history
  • Loading branch information
mehfuzh authored Jan 10, 2025
1 parent af98005 commit 0b8e767
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 3 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,20 @@ smartloop project set --id=project_id --temp=0.3
```
To enable memory to retain context in the conversation, use the following command:
```bash
smartloop project set --id=project_id --memory
```
To disable, use the following command:
```bash
smartloop project set --id=project_id --no-memory
```
`LLM temperature is a parameter that influences the language model's output, determining whether the output is more random and creative or more predictable.`
The higher value tends towards more creative answer
Expand Down
2 changes: 1 addition & 1 deletion smartloop/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.

__version__="1.2.1"
__version__="1.2.2"
6 changes: 4 additions & 2 deletions smartloop/cmd/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ def get(id: Annotated[str, typer.Option(help="id of the project")]):
print(ex)

@app.command(short_help="Set project properties")
def set(id: Annotated[str, typer.Option(help="project Id to use")], temp: Annotated[float, typer.Option(help="Set a temperature between 0.0 and 1.0")] = 0.3):
def set(id: Annotated[str, typer.Option(help="project Id to use")],
temp: Annotated[float, typer.Option(help="Set a temperature between 0.0 and 1.0")] = 0.3,
memory: Annotated[bool, typer.Option(help="Set LLM memory to enable / disable conversation history")] = False):
profile = UserProfile.current_profile()
projects = [
project for project in Projects(profile).get_all()
Expand All @@ -134,7 +136,7 @@ def set(id: Annotated[str, typer.Option(help="project Id to use")], temp: Annota
# check for length
if len(projects) > 0:
profile['project'] = projects[0]
Projects(profile).set_config(dict(temperature=temp))
Projects(profile).set_config(dict(temperature=temp, memory=memory))
else:
console.print("No project found")

Expand Down

0 comments on commit 0b8e767

Please sign in to comment.