-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8a4a355
commit 466ec4e
Showing
8 changed files
with
146 additions
and
99 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
from hal9.core import * | ||
from hal9.api import * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
import requests | ||
import time | ||
import tempfile | ||
import sys | ||
import runpy | ||
|
||
def create(path :str, template :str) -> str: | ||
"""Create an application | ||
Parameters | ||
---------- | ||
path : str | ||
Path to the application. | ||
template : str | ||
The template to use. | ||
""" | ||
|
||
print(f'Project created! {name}') | ||
|
||
def run(path :str) -> str: | ||
"""Run an application | ||
Parameters | ||
---------- | ||
path : str | ||
Path to the application. | ||
""" | ||
|
||
print(f'Project created! {name}') | ||
|
||
def deploy(path :str, target :str) -> str: | ||
"""Deploy an application | ||
Parameters | ||
---------- | ||
path : str | ||
Path to the application. | ||
target : str | ||
The deployment target, defaults to 'hal9.com'. | ||
""" | ||
|
||
response = requests.post('https://api.hal9.com/api/v1/deploy', json = { | ||
'name': 'name', | ||
'title': 'title', | ||
'description': 'description', | ||
'access': 'access', | ||
'code': 'code', | ||
'prompt': 'prompt', | ||
'thumbnail': 'thumbnail', | ||
'token': 'token', | ||
'user': 'user', | ||
}) | ||
|
||
if not response.ok: | ||
print('Failed to deploy') | ||
exit() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import click | ||
from collections import OrderedDict | ||
from hal9.api import * | ||
|
||
@click.group() | ||
def cli(): | ||
""" | ||
Create and Deploy Generative Applications | ||
Use this tool to create apps from templates that use Generative AI, | ||
run them locally and deploy them to the cloud. | ||
""" | ||
pass | ||
|
||
@click.command() | ||
@click.argument('path') | ||
def create(path): | ||
""" | ||
Create Project | ||
PATH: The path for the new project. Required argument. | ||
""" | ||
print(f'Creating: {path}') | ||
|
||
@click.command() | ||
@click.argument('path') | ||
def run(path): | ||
""" | ||
Run Project | ||
PATH: The path to the project. Required argument. | ||
""" | ||
print(f'Running {path}') | ||
|
||
@click.command() | ||
@click.argument('path') | ||
def deploy(path): | ||
""" | ||
Deploy Project | ||
PATH: The path to the project. Required argument. | ||
""" | ||
print(f'Deploying {path}') | ||
|
||
cli.add_command(create) | ||
cli.add_command(run) | ||
cli.add_command(deploy) | ||
|
||
if __name__ == "__main__": | ||
cli() |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
[tool.poetry] | ||
name = "hal9" | ||
version = "2.0.0" | ||
version = "2.0.1" | ||
description = "" | ||
authors = ["Javier Luraschi <[email protected]>"] | ||
readme = "README.md" | ||
|
@@ -9,6 +9,10 @@ readme = "README.md" | |
python = ">=3.8,<3.9.7 || >3.9.7,<4.0" | ||
requests = "^2.28.2" | ||
|
||
click = "^8.1.7" | ||
[build-system] | ||
requires = ["poetry-core"] | ||
build-backend = "poetry.core.masonry.api" | ||
|
||
[tool.poetry.scripts] | ||
hal9 = "hal9.cli:cli" |