Skip to content

Commit

Permalink
merge fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Cristhianzl committed Nov 22, 2024
2 parents fa88861 + bb646eb commit 1753d07
Show file tree
Hide file tree
Showing 121 changed files with 4,881 additions and 3,160 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docker_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ jobs:
- name: Test image
run: |
expected_version=$(cat pyproject.toml | grep version | head -n 1 | cut -d '"' -f 2)
version=$(docker run --rm --entrypoint bash langflowai/langflow:latest-dev -c 'python -c "from langflow.version.version import get_version; print(get_version())"')
version=$(docker run --rm --entrypoint bash langflowai/langflow:latest-dev -c "python -c 'from langflow.utils.version import get_version_info; print(get_version_info()[\"version\"])'")
if [ "$expected_version" != "$version" ]; then
echo "Expected version: $expected_version"
echo "Actual version: $version"
Expand All @@ -51,7 +51,7 @@ jobs:
- name: Test backend image
run: |
expected_version=$(cat pyproject.toml | grep version | head -n 1 | cut -d '"' -f 2)
version=$(docker run --rm --entrypoint bash langflowai/langflow-backend:latest-dev -c 'python -c "from langflow.version.version import get_version; print(get_version())"')
version=$(docker run --rm --entrypoint bash langflowai/langflow-backend:latest-dev -c "python -c 'from langflow.utils.version import get_version_info; print(get_version_info()[\"version\"])'")
if [ "$expected_version" != "$version" ]; then
echo "Expected version: $expected_version"
echo "Actual version: $version"
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/python_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -145,13 +145,16 @@ jobs:
if: steps.check-version.outputs.skipped == 'false'
run: |
make build main=true
- name: Install wheel
- name: Install wheel and Test CLI
if: steps.check-version.outputs.skipped == 'false'
run: |
python -m pip install dist/*.whl
uv venv new-venv
source new-venv/bin/activate
uv pip install dist/*.whl
- name: Test CLI
if: steps.check-version.outputs.skipped == 'false'
run: |
source new-venv/bin/activate
python -m langflow run --host 127.0.0.1 --port 7860 --backend-only &
SERVER_PID=$!
# Wait for the server to start
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ fix_codespell: ## run codespell to fix spelling errors

format: ## run code formatters
@uv run ruff check . --fix
@uv run ruff format .
@uv run ruff format . --config pyproject.toml
@cd src/frontend && npm run format

unsafe_fix:
Expand Down
10 changes: 3 additions & 7 deletions docs/docs/Agents/agent-tool-calling-agent-component.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,10 +148,6 @@ Text Analyzer: I can analyze and transform input text.
Current Date and Time: I can retrieve the current date and time in various time zones.
```

4. Click **Check & Save**.

Your component now has a **Tool Mode** button, and can be used by an agent.

## Make any component a tool

These components support **Tool Mode**:
Expand Down Expand Up @@ -181,12 +177,12 @@ inputs = [

## Add flows as tools

An agent can use flows that are saved in your workspace as tools.
An agent can use flows that are saved in your workspace as tools with the [Flow as Tool](/components-logic#flow-as-tool) component.

1. To add a **Flow as tool** component, click and drag a **Flow as tool** component to your workspace.
1. To add a **Flow as Tool** component, click and drag a **Flow as Tool** component to your workspace.
2. Select the flow you want the agent to use as a tool.
3. Connect the tool output to the agent's tools input.
4. Ask the agent, `What tools are you using to answer my questions?`
Your **Flow as tool** flow should be visible in the response.
Your **Flow as Tool** flow should be visible in the response.


4 changes: 3 additions & 1 deletion docs/docs/Components/components-agents.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
---
title: Types of agents in Langflow
title: Agents
sidebar_position: 12
slug: /components-agents
---

# Agent components in Langflow

Agent components are used to define the behavior and capabilities of AI agents in your flow. Agents can interact with APIs, databases, and other services and use LLMs as a reasoning engine to decide which course to take in your flow.

## Agent component {#agent-component}
Expand Down
7 changes: 6 additions & 1 deletion docs/docs/Components/components-logic.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
---
title: Logic
sidebar_position: 13
slug: /components-logic
---
# Logic components in Langflow

Logic components provide functionalities for routing, conditional processing, and flow management.
Expand Down Expand Up @@ -50,7 +55,7 @@ This component is particularly useful in workflows that require conditional rout
| false_output | Data/List | Output when the condition is not met. |


## Flow as Tool
## Flow as Tool {#flow-as-tool}

This component constructs a tool from a function that runs a loaded flow.

Expand Down
6 changes: 3 additions & 3 deletions docs/docs/Guides/guides-chat-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ slug: /guides-chat-memory



Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate _memories_ for agents to store and recall information as needed.
Langflow allows every chat message to be stored, and a single flow can have multiple memory sessions. This enables you to create separate _memories_ for agents to store and recall information as needed.


In any project, as long as there are [**Chat**](/components-io) being used, memories are always being stored by default. These are messages from a user to the AI or vice-versa.
Expand All @@ -26,7 +26,7 @@ Memories can be visualized and managed directly from the **Playground**. You can

Modifying these memories will influence the behavior of the chatbot responses, as long as an agent uses them. Here you have the ability to remove or edit previous messages, allowing them to manipulate and explore how these changes affect model responses.

To modify chat memories, click your **Flow Name**, and then click **Logs**.
To modify chat memories, from the playground, click the **Options** menu of any session, and then select **Message Logs**.


![](/img/logs.png)
Expand All @@ -45,7 +45,7 @@ The **Chat Memory** component also retrieves message histories by `Session ID`,

![](/img/chat-input-controls-pane.png)

By default, if the `Session ID` value is empty, it is set to match the the same value as the `Flow ID`.
By default, if the `Session ID` value is empty, it is set to the same value as `Flow ID`.

You can also display all messages stored across every flow and session by going to **Settings** > **Messages**.

Expand Down
36 changes: 23 additions & 13 deletions docs/docs/Guides/guides-data-message.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,28 +60,38 @@ print(data.title) # Outputs: "Hello, World!" because "title" key is in the data
The `Data` object is also convenient for visualization of outputs, since the output preview has visual elements to inspect data as a table and its cells as pop ups for basic types. The idea is to create a unified way to work and visualize complex information in Langflow.


To receive `Data` objects in a component input, you can use the `DataInput` input type.
To receive `Data` objects in a component input, you can use the `DataInput` input type.


## The Message Object {#f4f17cad02a545068f407d515cbc2902}
## Message object attributes {#f4f17cad02a545068f407d515cbc2902}


---


The `Message` object extends the functionality of `Data` and includes additional attributes and methods for chat interactions.

- **Main Attributes:**
- `text_key`: Key to retrieve the primary text data.
- `text`: The main text content of the message.
- `sender`: Identifier for the sender (e.g., "User" or "AI").
- `sender_name`: Name of the sender.
- `files`: List of files associated with the message.
- `session_id`: Identifier for the chat session.
- `timestamp`: Timestamp when the message was created.
- `flow_id`: Identifier for the flow.

The `Message` object can be used to send, store and manipulate chat messages within Langflow. You can create a `Message` object by directly assigning key-value pairs to it. For example:

- **Core message data:**
- `text`: The main text content of the message
- `sender`: Identifier for the sender (e.g., "User" or "AI")
- `sender_name`: Name of the sender
- `session_id`: Identifier for the chat session
- `timestamp`: Timestamp when the message was created (UTC)
- `flow_id`: Identifier for the flow
- `id`: Unique identifier for the message

- **Content and files:**
- `files`: List of files or images associated with the message
- `content_blocks`: List of structured content blocks
- `properties`: Additional properties including visual styling and source information

- **Message state:**
- `error`: Boolean indicating if there was an error
- `edit`: Boolean indicating if the message was edited
- `category`: Message category ("message", "error", "warning", "info")

The `Message` object can be used to send, store, and manipulate chat messages within Langflow. You can create a `Message` object by directly assigning key-value pairs to it. For example:


```python
Expand Down
Loading

0 comments on commit 1753d07

Please sign in to comment.