Skip to content

Commit

Permalink
ci: trigger workflow during release
Browse files Browse the repository at this point in the history
  • Loading branch information
deepankarm committed May 17, 2023
1 parent f01a294 commit a2e5fab
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
- name: Trigger build and push on langchain-serve
uses: peter-evans/repository-dispatch@v2
with:
token: ${{ secrets.DEEPANKAR_GITHUB_TOKEN }} # TODO: repo authors need to create a PAT and add it to secrets
token: ${{ secrets.SERVE_GITHUB_TOKEN }}
repository: jina-ai/langchain-serve
event-type: langflow-push
client-payload: '{"push_token": "${{ secrets.LCSERVE_PUSH_TOKEN }}", "branch": "dev"}' # TODO: repo authors need to store `LCSERVE_PUSH_TOKEN` in secrets
client-payload: '{"push_token": "${{ secrets.LCSERVE_PUSH_TOKEN }}", "branch": "dev"}'
48 changes: 45 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ Alternatively, click the **"Open in Cloud Shell"** button below to launch Google

Langflow integrates with langchain-serve to provide a one-command deployment to Jina AI Cloud.

Start by installing `langchain-serve` with `pip install -U langchain-serve`. Then, run:
Start by installing `langchain-serve` with

```bash
langflow jcloud
pip install -U langchain-serve
```

Then, run:

```bash
langflow --jcloud
```

```text
Expand Down Expand Up @@ -95,7 +101,43 @@ langflow jcloud

</details>

> Read more about customization, cost, and management of Langflow on Jina AI Cloud in the **[langchain-serve](https://github.com/jina-ai/langchain-serve)** repository.
#### API Usage

You can use Langflow directly on your browser, or use the API endpoints on Jina AI Cloud to interact with the server.

<details>
<summary>Show API usage (with python)</summary>

```python
import json
import requests

FLOW_PATH = "Time_traveller.json"

# HOST = 'http://localhost:7860'
HOST = 'https://langflow-f1ed20e309.wolf.jina.ai'
API_URL = f'{HOST}/predict'

def predict(message):
with open(FLOW_PATH, "r") as f:
json_data = json.load(f)
payload = {'exported_flow': json_data, 'message': message}
response = requests.post(API_URL, json=payload)
return response.json()


predict('Take me to 1920s Bangalore')
```

```json
{
"result": "Great choice! Bangalore in the 1920s was a vibrant city with a rich cultural and political scene. Here are some suggestions for things to see and do:\n\n1. Visit the Bangalore Palace - built in 1887, this stunning palace is a perfect example of Tudor-style architecture. It was home to the Maharaja of Mysore and is now open to the public.\n\n2. Attend a performance at the Ravindra Kalakshetra - this cultural center was built in the 1920s and is still a popular venue for music and dance performances.\n\n3. Explore the neighborhoods of Basavanagudi and Malleswaram - both of these areas have retained much of their old-world charm and are great places to walk around and soak up the atmosphere.\n\n4. Check out the Bangalore Club - founded in 1868, this exclusive social club was a favorite haunt of the British expat community in the 1920s.\n\n5. Attend a meeting of the Indian National Congress - founded in 1885, the INC was a major force in the Indian independence movement and held many meetings and rallies in Bangalore in the 1920s.\n\nHope you enjoy your trip to 1920s Bangalore!"
}
```

</details>

> Read more about resource customization, cost, and management of Langflow apps on Jina AI Cloud in the **[langchain-serve](https://github.com/jina-ai/langchain-serve)** repository.

## 🎨 Creating Flows
Expand Down
4 changes: 2 additions & 2 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ types-pillow = "^9.5.0.2"


[tool.poetry.extras]
production = ["langchain-serve"]
deploy = ["langchain-serve"]

[tool.ruff]
line-length = 120
Expand Down
7 changes: 5 additions & 2 deletions src/backend/langflow/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,15 @@ def serve(
config: str = typer.Option("config.yaml", help="Path to the configuration file."),
log_level: str = typer.Option("info", help="Logging level."),
log_file: Path = typer.Option("logs/langflow.log", help="Path to the log file."),
jcloud: bool = typer.Option(False, help="Deploy on Jina AI Cloud"),
):
"""
Run the Langflow server.
"""

if jcloud:
return serve_on_jcloud()

configure(log_level=log_level, log_file=log_file)
update_settings(config)
app = create_app()
Expand Down Expand Up @@ -69,8 +73,7 @@ def serve(
LangflowApplication(app, options).run()


@app.command()
def jcloud():
def serve_on_jcloud():
"""
Deploy Langflow server on Jina AI Cloud
"""
Expand Down

0 comments on commit a2e5fab

Please sign in to comment.