Skip to content

Commit

Permalink
Merge pull request #1374 from Jaseci-Labs/jac-cloud-docs-prep
Browse files Browse the repository at this point in the history
Move jac-cloud docs to jaclang site. Update readme for jac-cloud.
  • Loading branch information
ypkang authored Oct 13, 2024
2 parents 5c7d5c1 + d22fe52 commit 4013fc0
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 37 deletions.
28 changes: 21 additions & 7 deletions jac-cloud/README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,29 @@
# **jac-cloud**
# jac-cloud
`jac-cloud` is the cloud-native library for jac programs. `jac-cloud` automatically converts your jac program from a script-like local program to a production-readh server stack.

### Installation
### Install
#### From pip
```bash
pip install jac-cloud
```
### From source (for contributors)
```bash
git clone https://github.com/Jaseci-Labs/jaseci.git
cd jaseci/jac-cloud
pip install -e .
```
### Dependencies for Devs
#### Additional dependencies for contributors
```bash
pip install jaclang black pre-commit pytest flake8 flake8_import_order flake8_docstrings flake8_comprehensions flake8_bugbear flake8_annotations pep8_naming flake8_simplify mypy pytest
pre-commit install
```
# **REFERENCES**
### [**jac-cloud**](./docs/Jaseci.md)
### [**Environment Variables**](./docs/Environment-Variables.md)
### [**Logger**](./docs/Logger.md)

### Quick Start
Simply replace `jac run` with `jac serve`. `jac serve` starts an API server with a set of API endpoints corresponding to the walkers in the jac program.

`jac serve main.jac`

### API Docs
Once starts, navigate to `/docs` to access the built-in API docs.

For additional details, check out [our documentation](https://www.jac-lang.org/learn/guide/).
Original file line number Diff line number Diff line change
@@ -1,30 +1,14 @@
[<< back to main](../README.md)
# **jac-cloud**
# Jac Cloud

## **How To Start**
- `FastAPI.start` will convert walkers to FastAPI endpoints
- as default, `jac_cloud` have base user and sso apis
Just replace `jac run` with `jac serve` and you are now running your jac application as an API server.

## **Supported Args**
| **NAME** | **DESCRIPTION** | **ENVIRONMENT VARIABLE** | **DEFAULT** |
|-----------|-------------------|---------------------------|---------------|
| **host** | your local host | HOST | 0.0.0.0 |
| **port** | your local port | PORT | 8000 |
| **emailer** | overrided `jac_cloud.jaseci.utils.Emailer` | N/A | N/A |
| {**kwargs} | any fields that's currently supported in `uvicorn.run` | N/A | N/A |

```python
import:py from jac_cloud {FastAPI}
`jac serve main.jac`

with entry:__main__ {
FastAPI.start(
host="0.0.0.0",
port=8001
);
}
```
## **OPENAPI** (`/docs`)
![Default APIs](https://private-user-images.githubusercontent.com/74129725/355489885-ea5406a0-7a49-4fd2-b77d-10555e5100fb.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjI5NTQ5ODksIm5iZiI6MTcyMjk1NDY4OSwicGF0aCI6Ii83NDEyOTcyNS8zNTU0ODk4ODUtZWE1NDA2YTAtN2E0OS00ZmQyLWI3N2QtMTA1NTVlNTEwMGZiLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA4MDYlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwODA2VDE0MzEyOVomWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTk1MjNiM2EzYjI1MzM1Njk5MzdjNDRkYjExMzdiMzQ3MjczNzY1ODdkYTVhNmNlNGRiMjNmOWI2ZGQxMDY4ODgmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.nW6DNC3BBf98J0VGdpstXtsRdVrLIc85EJOo_00YyTs "Default APIs")
Optionally, specif host and port with `--host` and `--port`.

Once starts, navigate to `/docs` to access the built-in API docs.


## **Walker Endpoints**
Expand Down Expand Up @@ -138,13 +122,6 @@ walker post_with_body_and_file {
static has auth: bool = False;
}
}

with entry:__main__ {
FastAPI.start(
host="0.0.0.0",
port=8001
);
}
```

## **Walker Response Structure**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
[<< back to main](../README.md)
# **Supported Environment Variable**

| **NAME** | **DESCRIPTION** | **DEFAULT** |
Expand Down
File renamed without changes.
4 changes: 4 additions & 0 deletions jac/support/jac-lang.org/mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ nav:
- "learn/guide.md"
- "learn/jac_ref.md"
- "learn/impl_docs.md"
- Jac Cloud:
- "learn/coders/jac-cloud/docs/jac_cloud.md"
- "learn/coders/jac-cloud/docs/jac_cloud_logging.md"
- "learn/coders/jac-cloud/docs/jac_cloud_env_vars.md"
- MTLLM:
- "learn/with_llm.md"
- Quick Start:
Expand Down

0 comments on commit 4013fc0

Please sign in to comment.