Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: fixes api request custom component #2470

Merged
merged 30 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
49cfc37
bugfix: fix api request custom component
Cristhianzl Jul 2, 2024
3735d7e
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 2, 2024
6a2fe8b
Merge branch 'main' into cz/fix_errorapirequest
Cristhianzl Jul 2, 2024
dc99e0d
suggestions: add and verification on if
Cristhianzl Jul 2, 2024
8aa4dbe
merge fix
Cristhianzl Jul 2, 2024
c645732
merge with main
Cristhianzl Jul 2, 2024
18f9761
[autofix.ci] apply automated fixes
autofix-ci[bot] Jul 2, 2024
b4b3c2e
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
269df93
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
a4b929e
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
5d40667
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
21aaa7b
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
c41a7f7
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
50b423d
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
dc9e37e
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
d87d163
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
45955eb
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
eaaec54
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
b1e8a8f
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
dbceff3
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
e161a8f
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
3c8b302
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
67feb2c
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
86e9f3b
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
81729b5
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
f21d993
Merge branch 'main' into cz/fix_errorapirequest
github-actions[bot] Jul 2, 2024
9718b37
chore: Raise ValueError when decoding JSON data fails
Cristhianzl Jul 3, 2024
675d525
Merge branch 'cz/fix_errorapirequest' of https://github.com/langflow-…
Cristhianzl Jul 3, 2024
fe00de9
Merge branch 'main' into cz/fix_errorapirequest
Cristhianzl Jul 3, 2024
b20acc9
Merge branch 'main' into cz/fix_errorapirequest
ogabrielluiz Jul 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/auto-update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ jobs:
name: Auto-update
runs-on: ubuntu-latest
steps:
- uses: tibdex/auto-update@v2
- uses: tibdex/auto-update@v2
1 change: 0 additions & 1 deletion .github/workflows/docs_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ on:
env:
NODE_VERSION: "21"


jobs:
test-docs-build:
name: Test Docs Build
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/js_autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,4 @@ jobs:
cd src/frontend
npm run format

- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
2 changes: 0 additions & 2 deletions .github/workflows/lint-js.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,3 @@ jobs:
run: |
cd src/frontend
npm run check-format


2 changes: 1 addition & 1 deletion .github/workflows/py_autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ jobs:
- run: ruff check --fix-only .
- run: ruff format .

- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
- uses: autofix-ci/action@dd55f44df8f7cdb7a6bf74c78677eb8acd40cd0a
3 changes: 0 additions & 3 deletions .github/workflows/style-check-py.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,3 @@ jobs:
run: echo "::add-matcher::.github/workflows/matchers/ruff.json"
- name: Run Ruff Check
run: poetry run ruff check --output-format=github .



3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,11 @@ results = run_flow_from_json("path/to/flow.json", input_value="Hello, World!")
# Deploy

## DataStax Langflow

DataStax Langflow is a hosted version of Langflow integrated with [AstraDB](https://www.datastax.com/products/datastax-astra). Be up and running in minutes with no installation or setup required. [Sign up for free](https://langflow.datastax.com).

## Deploy Langflow on Hugging Face Spaces

You can also preview Langflow in [HuggingFace Spaces](https://huggingface.co/spaces/Langflow/Langflow-Preview). [Clone the space using this link](https://huggingface.co/spaces/Langflow/Langflow-Preview?duplicate=true) to create your own Langflow workspace in minutes.

## Deploy Langflow on Google Cloud Platform
Expand All @@ -121,7 +123,6 @@ Use this template to deploy Langflow 1.0 on Railway:

Follow our step-by-step guide to deploy [Langflow on Kubernetes](https://github.com/langflow-ai/langflow/blob/dev/docs/docs/deployment/kubernetes.md).


# 🖥️ Command Line Interface (CLI)

Langflow provides a command-line interface (CLI) for easy management and configuration.
Expand Down
12 changes: 10 additions & 2 deletions src/backend/base/langflow/components/data/APIRequest.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,10 +111,18 @@ async def make_request(
if method not in ["GET", "POST", "PATCH", "PUT", "DELETE"]:
raise ValueError(f"Unsupported method: {method}")

if isinstance(body, str) and body:
try:
body = json.loads(body)
except Exception as e:
logger.error(f"Error decoding JSON data: {e}")
Cristhianzl marked this conversation as resolved.
Show resolved Hide resolved
body = None
raise ValueError(f"Error decoding JSON data: {e}")

data = body if body else None
payload = json.dumps(data) if data else None

try:
response = await client.request(method, url, headers=headers, content=payload, timeout=timeout)
response = await client.request(method, url, headers=headers, json=data, timeout=timeout)
try:
result = response.json()
except Exception:
Expand Down
7 changes: 6 additions & 1 deletion src/backend/base/langflow/graph/vertex/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,12 @@ def _build_params(self):
# we don't know the key of the dict but we need to set the value
# to the vertex that is the source of the edge
param_dict = template_dict[param_key]["value"]
params[param_key] = {key: self.graph.get_vertex(edge.source_id) for key in param_dict.keys()}
if param_dict:
params[param_key] = {
key: self.graph.get_vertex(edge.source_id) for key in param_dict.keys()
}
else:
params[param_key] = self.graph.get_vertex(edge.source_id)
else:
params[param_key] = self.graph.get_vertex(edge.source_id)

Expand Down
2 changes: 1 addition & 1 deletion src/backend/base/langflow/inputs/inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ class NestedDictInput(BaseInputMixin, ListableInputMixin, MetadataTraceMixin, In
"""

field_type: Optional[SerializableFieldTypes] = FieldTypes.NESTED_DICT
value: Optional[dict] = {}
value: Optional[dict | Data] = {}


class DictInput(BaseInputMixin, ListableInputMixin, InputTraceMixin):
Expand Down