Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
pr review
Browse files Browse the repository at this point in the history
  • Loading branch information
acatav committed Feb 8, 2024
1 parent 7d3d467 commit e856feb
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
11 changes: 0 additions & 11 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,17 +195,6 @@ INFO: Uvicorn running on http://0.0.0.0:8000 (Press CTRL+C to quit)
### Stopping the server
To stop the server, simply press `CTRL+C` in the terminal where you started it.

### Dumping a config Yaml template file

The first step in writing your own configuration file is to start from a valid template. You can dump a configuration file template using the following command:

```bash
canopy gen-config /path/to/my-config.yaml --template cohere.yaml
```

You can find the available templates under [src/canopy/config](src/canopy/config/).


## Evaluation chat tool

Canopy's CLI comes with a built-in chat app that allows you to interactively chat with your text data and compare RAG vs. non-RAG workflows side-by-side to evaluate the results
Expand Down
8 changes: 6 additions & 2 deletions src/canopy_cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ def __init__(self, name=None, commands=None, **attrs):
"health": 4,
"stop": 5,
"api-docs": 6,
"gen-config": 7,
"create-config": 7,
}

def list_commands(self, ctx):
Expand Down Expand Up @@ -214,11 +214,15 @@ def health(url):
@cli.command(help="Writes a config template YAML file to the specified path.")
@click.argument("path", type=click.Path(), required=True)
@click.option("--template", default="default", help="The name of the template to use.")
def gen_config(path, template):
def create_config(path, template):

if not template.endswith('.yaml'):
template += '.yaml'

if os.path.exists(path):
click.confirm(click.style(f"File {path} already exists. Overwrite?", fg="red"),
abort=True)

try:
with pkg_resources.open_text('canopy.config', template) as f:
config = yaml.safe_load(f)
Expand Down

0 comments on commit e856feb

Please sign in to comment.