Skip to content

Commit

Permalink
Merge branch 'main' into chore/preserve-component-data
Browse files Browse the repository at this point in the history
  • Loading branch information
italojohnny authored Jan 17, 2025
2 parents 8bf133d + 88111c3 commit bdc0b74
Show file tree
Hide file tree
Showing 136 changed files with 4,327 additions and 1,683 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/add-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Manage Review Labels

on:
pull_request_review:
types: [submitted]

jobs:
label-on-review:
runs-on: ubuntu-latest
permissions:
pull-requests: write
issues: write
steps:
- name: Manage LGTM Review Label
uses: actions/github-script@v7
with:
script: |
const LGTM_LABEL = 'lgtm';
// Extract review details
const { state: reviewState } = context.payload.review;
const pullRequestNumber = context.payload.pull_request.number;
const repoDetails = {
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: pullRequestNumber
};
// Log review information
console.log(`Processing review for PR #${pullRequestNumber}`);
console.log(`Review state: ${reviewState}`);
// Helper function to check for LGTM label
async function hasLgtmLabel() {
const { data: labels } = await github.rest.issues.listLabelsOnIssue(repoDetails);
return labels.some(label => label.name === LGTM_LABEL);
}
if (reviewState === 'approved') {
const lgtmExists = await hasLgtmLabel();
if (!lgtmExists) {
console.log(`Adding ${LGTM_LABEL} label to PR #${pullRequestNumber}`);
await github.rest.issues.addLabels({
...repoDetails,
labels: [LGTM_LABEL]
});
console.log('Label added successfully');
} else {
console.log(`${LGTM_LABEL} label already exists`);
}
} else if (reviewState === 'changes_requested') {
const lgtmExists = await hasLgtmLabel();
if (lgtmExists) {
console.log(`Removing ${LGTM_LABEL} label from PR #${pullRequestNumber}`);
await github.rest.issues.removeLabel({
...repoDetails,
name: LGTM_LABEL
});
console.log('Label removed successfully');
} else {
console.log(`No ${LGTM_LABEL} label to remove`);
}
}
8 changes: 3 additions & 5 deletions .github/workflows/store_pytest_durations.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,9 @@ jobs:
- name: Install the project
run: uv sync --dev
- name: Run unit tests
uses: nick-fields/retry@v3
with:
timeout_minutes: 12
max_attempts: 2
command: uv run pytest src/backend/tests --durations-path src/backend/tests/.test_durations --splitting-algorithm least_duration --store-durations
id: run_tests
continue-on-error: true
run: uv run pytest src/backend/tests/unit --durations-path src/backend/tests/.test_durations --splitting-algorithm least_duration --store-durations
- name: Minimize uv cache
run: uv cache prune --ci

Expand Down
2 changes: 1 addition & 1 deletion docs/docs/API-Reference/api-reference-api-examples.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export LANGFLOW_URL="http://127.0.0.1:7860"
```

* Export the `flow-id` in your terminal.
The `flow-id` is found in the [API pane](/workspace-api) or in the flow's URL.
The `flow-id` is found in the [API pane](/concepts-api) or in the flow's URL.
```plain
export FLOW_ID="359cd752-07ea-46f2-9d3b-a4407ef618da"
```
Expand Down
86 changes: 28 additions & 58 deletions docs/docs/Components/components-embedding-models.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,14 @@ This embeddings component uses an OpenAI API key for authentication. Refer to yo

This component generates embeddings using the [AI/ML API](https://docs.aimlapi.com/api-overview/embeddings).

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
| model_name | String | The name of the AI/ML embedding model to use |
| aiml_api_key | SecretString | API key for authenticating with the AI/ML service |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -40,9 +38,7 @@ This component generates embeddings using the [AI/ML API](https://docs.aimlapi.c

This component is used to load embedding models from [Amazon Bedrock](https://aws.amazon.com/bedrock/).

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -51,7 +47,7 @@ This component is used to load embedding models from [Amazon Bedrock](https://aw
| endpoint_url | String | URL to set a specific service endpoint other than the default AWS endpoint |
| region_name | String | AWS region to use, e.g., `us-west-2`. Falls back to `AWS_DEFAULT_REGION` environment variable or region specified in ~/.aws/config if not provided |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -64,9 +60,7 @@ Connect this component to the **Embeddings** port of the [Astra DB vector store
This component requires that your Astra DB database has a collection that uses a vectorize embedding provider integration.
For more information and instructions, see [Embedding Generation](https://docs.datastax.com/en/astra-db-serverless/databases/embedding-generation.html).

### Parameters

#### Inputs
### Inputs

| Name | Display Name | Info |
|------|--------------|------|
Expand All @@ -76,7 +70,7 @@ For more information and instructions, see [Embedding Generation](https://docs.d
| provider_api_key | Provider API Key | As an alternative to `authentication`, directly provide your embedding provider credentials. |
| model_parameters | Model Parameters | Additional model parameters |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -86,9 +80,7 @@ For more information and instructions, see [Embedding Generation](https://docs.d

This component generates embeddings using Azure OpenAI models.

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -98,7 +90,7 @@ This component generates embeddings using Azure OpenAI models.
| API Version | String | The API version to use, options include various dates |
| API Key | String | The API key to access the Azure OpenAI service |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -108,17 +100,15 @@ This component generates embeddings using Azure OpenAI models.

This component is used to load embedding models from [Cohere](https://cohere.com/).

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
| cohere_api_key | String | API key required to authenticate with the Cohere service |
| model | String | Language model used for embedding text documents and performing queries (default: `embed-english-v2.0`) |
| truncate | Boolean | Whether to truncate the input text to fit within the model's constraints (default: `False`) |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -128,16 +118,14 @@ This component is used to load embedding models from [Cohere](https://cohere.com

This component computes selected forms of similarity between two embedding vectors.

### Parameters

#### Inputs
### Inputs

| Name | Display Name | Info |
|------|--------------|------|
| embedding_vectors | Embedding Vectors | A list containing exactly two data objects with embedding vectors to compare. |
| similarity_metric | Similarity Metric | Select the similarity metric to use. Options: "Cosine Similarity", "Euclidean Distance", "Manhattan Distance". |

#### Outputs
### Outputs

| Name | Display Name | Info |
|------|--------------|------|
Expand All @@ -147,16 +135,14 @@ This component computes selected forms of similarity between two embedding vecto

This component connects to Google's generative AI embedding service using the GoogleGenerativeAIEmbeddings class from the `langchain-google-genai` package.

### Parameters

#### Inputs
### Inputs

| Name | Display Name | Info |
|------|--------------|------|
| api_key | API Key | Secret API key for accessing Google's generative AI service (required) |
| model_name | Model Name | Name of the embedding model to use (default: "models/text-embedding-004") |

#### Outputs
### Outputs

| Name | Display Name | Info |
|------|--------------|------|
Expand All @@ -173,9 +159,7 @@ This component loads embedding models from HuggingFace.

Use this component to generate embeddings using locally downloaded Hugging Face models. Ensure you have sufficient computational resources to run the models.

### Parameters

#### Inputs
### Inputs

| Name | Display Name | Info |
|------|--------------|------|
Expand All @@ -191,9 +175,7 @@ This component generates embeddings using Hugging Face Inference API models.

Use this component to create embeddings with Hugging Face's hosted models. Ensure you have a valid Hugging Face API key.

### Parameters

#### Inputs
### Inputs

| Name | Display Name | Info |
|------|--------------|------|
Expand All @@ -209,9 +191,7 @@ Use this component to create embeddings with Hugging Face's hosted models. Ensur

This component generates embeddings using MistralAI models.

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -222,7 +202,7 @@ This component generates embeddings using MistralAI models.
| timeout | Integer | Request timeout in seconds (default: 120) |
| endpoint | String | Custom API endpoint URL (default: `https://api.mistral.ai/v1/`) |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -232,9 +212,7 @@ This component generates embeddings using MistralAI models.

This component generates embeddings using NVIDIA models.

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -243,7 +221,7 @@ This component generates embeddings using NVIDIA models.
| nvidia_api_key | SecretString | API key for authenticating with NVIDIA's service |
| temperature | Float | Model temperature for embedding generation (default: `0.1`) |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -253,17 +231,15 @@ This component generates embeddings using NVIDIA models.

This component generates embeddings using Ollama models.

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
| Ollama Model | String | Name of the Ollama model to use (default: `llama2`) |
| Ollama Base URL | String | Base URL of the Ollama API (default: `http://localhost:11434`) |
| Model Temperature | Float | Temperature parameter for the model. Adjusts the randomness in the generated embeddings |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -273,9 +249,7 @@ This component generates embeddings using Ollama models.

This component is used to load embedding models from [OpenAI](https://openai.com/).

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -302,7 +276,7 @@ This component is used to load embedding models from [OpenAI](https://openai.com
| TikToken Enable | Boolean | Whether to enable TikToken (default: `True`) |
| TikToken Model Name | String | Name of the TikToken model |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -312,16 +286,14 @@ This component is used to load embedding models from [OpenAI](https://openai.com

This component generates embeddings for a given message using a specified embedding model.

### Parameters

#### Inputs
### Inputs

| Name | Display Name | Info |
|------|--------------|------|
| embedding_model | Embedding Model | The embedding model to use for generating embeddings. |
| message | Message | The message for which to generate embeddings. |

#### Outputs
### Outputs

| Name | Display Name | Info |
|------|--------------|------|
Expand All @@ -331,9 +303,7 @@ This component generates embeddings for a given message using a specified embedd

This component is a wrapper around [Google Vertex AI](https://cloud.google.com/vertex-ai) [Embeddings API](https://cloud.google.com/vertex-ai/docs/generative-ai/embeddings/get-text-embeddings).

### Parameters

#### Inputs
### Inputs

| Name | Type | Description |
|------|------|-------------|
Expand All @@ -349,7 +319,7 @@ This component is a wrapper around [Google Vertex AI](https://cloud.google.com/v
| tuned_model_name | String | The name of a tuned model. If provided, `model_name` is ignored |
| verbose | Boolean | This parameter controls the level of detail in the output. When set to `True`, it prints internal states of the chain to help debug (default: `False`) |

#### Outputs
### Outputs

| Name | Type | Description |
|------|------|-------------|
Expand Down
6 changes: 3 additions & 3 deletions docs/docs/Components/components-io.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This category of components defines where data enters and exits your flow. They

The difference between Chat Input and Text Input components is the output format, the number of configurable fields, and the way they are displayed in the Playground.

### Chat Input
## Chat Input

This component collects user input from the chat.

Expand Down Expand Up @@ -83,13 +83,13 @@ The Chat Output component creates a [Message](/configuration-objects) object tha

The TextOutputComponent displays text output in the **Playground**. It takes a single input of text and returns a [Message](/configuration-objects) object containing that text. The component is simpler compared to the Chat Output, but focuses solely on displaying text without additional chat-specific features or customizations.

## Inputs
### Inputs

| Name | Display Name | Info | Type |
|------|--------------|------|------|
|input_value|Text|Text to be passed as output.|MultilineInput|

## Outputs
### Outputs

| Name | Display Name | Info |
|------|--------------|------|
Expand Down
Loading

0 comments on commit bdc0b74

Please sign in to comment.