Commit graph

8,005 commits

Author SHA1 Message Date
anovazzi1
c7435c0c49 Revert "Refactor code and fix formatting issues"
This reverts commit 334ec24addf783990850b835d911ac778dfce6a2.
2024-01-08 13:39:32 -03:00
anovazzi1
f8f71fb603 Refactor code and fix formatting issues 2024-01-08 13:39:32 -03:00
anovazzi1
a76263097a Add cookies for access and refresh tokens 2024-01-08 13:38:58 -03:00
Mạnh Phạm
15955d18a5
Update AgentInitializer.py
Fix AgentInitializer to has last statement of return base class
2024-01-08 10:35:30 +07:00
Gabriel Luiz Freitas Almeida
b1ec1225ff Update langchain version to 0.1.0 and add langchain-openai dependency 2024-01-07 20:06:41 -03:00
Gabriel Luiz Freitas Almeida
4c89bee640 Update tool imports in constants.py 2024-01-07 20:06:35 -03:00
Gabriel Luiz Freitas Almeida
cef8fd7e74 Update import statements in ChatOllamaEndpoint.py 2024-01-07 20:06:27 -03:00
Gabriel Luiz Freitas Almeida
de292b8fff Refactor OllamaLLM imports and remove unnecessary code 2024-01-07 20:06:20 -03:00
coolgo0811
483cf07d7f
Merge branch 'logspace-ai:dev' into fix/vectorstores/pgvector 2024-01-07 12:14:02 +08:00
coolgo0811
96ebc115f3 Rename the component's output. 2024-01-07 12:12:06 +08:00
Gabriel Luiz Freitas Almeida
357cad48b9 Update lock 2024-01-06 16:27:39 -03:00
Gabriel Luiz Freitas Almeida
d2257441f5
Added Elasticsearch Vector Store (#1286)
In this pull request, I have:
- added Elasticsearch component on Vector Store
- functionality is basic to get started quickly

**Set up a Single-node Elasticsearch cluster on localhost on docker**
1. sudo docker network create elastic
2. sudo docker run --net elastic -p 9200:9200 -e
"discovery.type=single-node" -e "xpack.security.enabled=false" -e
"xpack.security.http.ssl.enabled=false" -d
docker.elastic.co/elasticsearch/elasticsearch:8.11.3
3. curl http://localhost:9200
   {
     "name" : "994a10c1dab5",
     "cluster_name" : "docker-cluster",
     "cluster_uuid" : "p_iQ88F-T2agFpIdzJN7Ow",
     "version" : {
       "number" : "8.11.3",
       "build_flavor" : "default",
       "build_type" : "docker",
       "build_hash" : "64cf052f3b56b1fd4449f5454cb88aca7e739d9a",
       "build_date" : "2023-12-08T11:33:53.634979452Z",
       "build_snapshot" : false,
       "lucene_version" : "9.8.0",
       "minimum_wire_compatibility_version" : "7.17.0",
       "minimum_index_compatibility_version" : "7.0.0"
     },
     "tagline" : "You Know, for Search"
   }
4. curl -GET http://localhost:9200/_cat/indices
   No indices are available

**Set up Langlow:**
1. make backend
2. make frontend
3. open localhost:3000
4. New Project -> Import from JSON: elasticsearch-langflow.json
**[elasticsearch-langflow.json](https://github.com/logspace-ai/langflow/files/13823444/elasticsearch-langflow.json)**
5. poetry add elasticsearch or pipenv install elasticsearch or pip
install elasticsearch
6. Select text file to load
7. Provide OpenAPI keys for OpenAIEmbeddings and ChatOpenAI
8. Build
9. Verify that document is indexed: curl -GET
http://localhost:9200/_cat/indices
health status index uuid pri rep docs.count docs.deleted store.size
pri.store.size dataset.size
yellow open test-index pt9_ZOACR8mWCNx7GO3scA 1 1 1 0 39.3kb 39.3kb
39.3kb
10. Open Chat and you can ask: "What is the document about?"
2024-01-06 16:23:51 -03:00
Gabriel Luiz Freitas Almeida
0c592c8f06
Merge branch 'dev' into vectorstores/elasticsearch 2024-01-06 16:23:42 -03:00
Gabriel Luiz Freitas Almeida
a5aef06544
Adds ChatDefinition utility (#1279)
The ChatDefinition allows users to turn any flow into a Chat flow by
defining what has to run and what are the inputs and outputs.

The ChatDefinition requires a function, inputs(optional) and
output_key(optional).
The function receives a dictionary as input and can output a string or a
dict. If the output is a dict, then an output_key must be provided.

Anything can run inside the function. You can also pass methods of
pre-built classes like a Chain.

Here's an example of how to use it in a CustomComponent:

```python
from langflow import CustomComponent
from langflow.utils.chat import ChatDefinition

class Component(CustomComponent):
    documentation: str = "http://docs.langflow.org/components/custom"

    def build(self) -> Data:
        
        def func(inputs, callbacks):
            return {"text":'This is a simple example.'}
        
        return ChatDefinition(func=func, inputs=[], output_key="text")
```
2024-01-06 16:17:14 -03:00
Lucas Oliveira
c3bfcca6e2 Removed manual saving, only autosave now 2024-01-06 15:28:05 -03:00
Lucas Oliveira
4a3035873b Refactored stars and version refreshing 2024-01-06 15:15:25 -03:00
Lucas Oliveira
f87379c3d7 removed console log of errors 2024-01-06 15:01:22 -03:00
Lucas Oliveira
db99d64139 added function to useCallback 2024-01-06 14:58:42 -03:00
Lucas Oliveira
9ec2fe445d Fixed nodes cant be dropped when refreshing page 2024-01-06 14:57:42 -03:00
Lucas Oliveira
bacab7dbc1 changed sideBarDraggableComponent to forwardRef 2024-01-06 14:46:49 -03:00
Lucas Oliveira
7d04a98f68 Fixed button inside button on sidebar 2024-01-06 14:39:57 -03:00
Lucas Oliveira
f0f5887452 Fixed message of button inside button at Admin page 2024-01-06 14:31:28 -03:00
Lucas Oliveira
c34810b161 Fixed Confirmation Modal ref 2024-01-06 12:22:30 -03:00
Lucas Oliveira
290fc96d02 Fixed ctrl+z on intComponent 2024-01-06 11:57:44 -03:00
Lucas Oliveira
6abac9782d Fixed ctrl+z not working inside input 2024-01-06 11:45:33 -03:00
Lucas Oliveira
b4f7285b33 Implemented undoRedo on Zustand 2024-01-06 11:34:36 -03:00
Lucas Oliveira
882f365ff6 Passed the rest of the flowsContext functions to zustand, removed flowsContext 2024-01-06 01:27:54 -03:00
Lucas Oliveira
616a4f0031 added upload and download flows on zustand and utils 2024-01-06 01:00:59 -03:00
Lucas Oliveira
d44648d6c1 added saveFlow function to Zustand state and implemented it on the project 2024-01-06 00:27:36 -03:00
Lucas Oliveira
e3c3b18bdc Added refresh flows function 2024-01-05 23:48:55 -03:00
Lucas Oliveira
82f180315b added the implementation of flowsState in all the project 2024-01-05 23:28:03 -03:00
Lucas Oliveira
118e425d68 added flows variable and current flow and state to zustand 2024-01-05 23:05:32 -03:00
Lucas Oliveira
6195acee22 added CurrentFlowState to zustand 2024-01-05 22:19:45 -03:00
Lucas Oliveira
18b2f5e970 if health returns, the fetchError error is removed 2024-01-05 21:18:16 -03:00
Lucas Oliveira
4e29a92657 Removed getHealth from getTypes and made it refresh every 5 seconds 2024-01-05 21:17:01 -03:00
Lucas Oliveira
03d7020185 Implemented types context at Zustand and at the whole project 2024-01-05 21:07:18 -03:00
Lucas Oliveira
7f8f5d3f7b refactored authentication 2024-01-05 18:52:44 -03:00
Lucas Oliveira
f5ae805db1 Removed unused console.log 2024-01-05 18:15:25 -03:00
Lucas Oliveira
6a6d11447b Get types done at App.tsx and fixed handle position 2024-01-05 18:13:51 -03:00
anovazzi1
ac448bdd09 code refactor 2024-01-05 17:08:12 -03:00
anovazzi1
b105d60cc5 Refactor node creation logic in PageComponent 2024-01-05 17:04:00 -03:00
Lucas Oliveira
48e62fedea Removed alertsContext from contexts 2024-01-05 13:16:29 -03:00
Lucas Oliveira
de5e464e99 Removed AlertContext from all files 2024-01-05 13:16:01 -03:00
Lucas Oliveira
cc776b3196 Implemented Zustand Alert and changed all the usages 2024-01-05 13:14:00 -03:00
Lucas Oliveira
df12f33e86 Removed useEffects from flowsContext 2024-01-05 12:41:45 -03:00
Lucas Oliveira
a75d70b49c Fixed typing and naming of zustand functions 2024-01-05 12:17:52 -03:00
Lucas Oliveira
0dad0eb540 changed useDark to selector instead of destructuring 2024-01-05 11:55:37 -03:00
Lucas Oliveira
503e7766ba changed useFlow declaration from destructuring to selector to improve performance 2024-01-05 11:49:07 -03:00
cristhianzl
68e5454b11 feat(headerComponent): add support for storeStore in headerComponent to manage store state
refactor(headerComponent): refactor useDarkStore calls in headerComponent to improve readability and maintainability
2024-01-05 11:44:00 -03:00
cristhianzl
97d7f330ea refactor(extraSidebarComponent): remove unused context variable and import to improve code readability and maintainability 2024-01-05 11:41:47 -03:00