Skip to content

Commit

Permalink
rename template connector
Browse files Browse the repository at this point in the history
  • Loading branch information
walterbm-cohere committed Dec 3, 2023
1 parent 33a8a8b commit e4f2a60
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 4 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
.vscode/
**/dev/data/
*.pyc
.trunk/
.DS_Store
milvus/volumes/

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,6 @@ def create_app() -> connexion.FlaskApp:
logging.basicConfig(level=logging.INFO)
flask_app = app.app
# load environment variables prefixed with the name of the current directory
config_prefix = os.path.split(os.getcwd())[1].upper()
config_prefix = os.path.split(os.getcwd())[1].upper().replace("_", "")
flask_app.config.from_prefixed_env(config_prefix)
return flask_app
24 changes: 21 additions & 3 deletions template/provider/app.py → _template_/provider/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,29 @@ def search(body):
# - a url field that points to the source of the data
data = [
{
"id": "0",
"id": "1",
"title": "Tall penguins",
"text": "Emperor penguins are the tallest",
"text": "The tallest penguin is the Emperor penguin",
"url": "https://en.wikipedia.org/wiki/Penguin",
}
},
{
"id": "2",
"title": "Emperor penguins",
"text": "The latin name for Emperor penguin is Aptenodytes forsteri",
"url": "https://en.wikipedia.org/wiki/Penguin",
},
{
"id": "3",
"title": "Small penguins",
"text": "The smallest penguin is the fairy penguin",
"url": "https://en.wikipedia.org/wiki/Penguin",
},
{
"id": "4",
"title": "Eudyptula penguis",
"text": "The latin name for fairy penguin is Eudyptula minor",
"url": "https://en.wikipedia.org/wiki/Penguin",
},
]

return {"results": data}
Expand Down
File renamed without changes.

0 comments on commit e4f2a60

Please sign in to comment.