langflow
langflow copied to clipboard
lots of errors in 0.0.65
ValueError: Error building node ChatOpenAI: 1 validation error for ChatOpenAI
__root__
Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a
named parameter. (type=value_error)
ERROR [09:12:45] - ERROR - Error building node ChatOpenAI: 1 validation error for ChatOpenAI validate.py:52
__root__
Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a
named parameter. (type=value_error)
╭───────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────╮
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/graph/base.py:190 in _build │
│ │
│ 187 │ │ # and return the instance │
│ 188 │ │ │
│ 189 │ │ try: │
│ ❱ 190 │ │ │ self._built_object = loading.instantiate_class( │
│ 191 │ │ │ │ node_type=self.node_type, │
│ 192 │ │ │ │ base_type=self.base_type, │
│ 193 │ │ │ │ params=self.params, │
│ │
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/interface/loading.py:97 in instantiate_class │
│ │
│ 94 │ │ if node_type == "SQLDatabase": │
│ 95 │ │ │ return class_object.from_uri(params.pop("uri")) │
│ 96 │ │
│ ❱ 97 │ return class_object(**params) │
│ 98 │
│ 99 │
│ 100 def load_flow_from_json(path: str, build=True): │
│ │
│ in pydantic.main.BaseModel.__init__:341 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValidationError: 1 validation error for ChatOpenAI
__root__
Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a
named parameter. (type=value_error)
The above exception was the direct cause of the following exception:
╭───────────────────────────────────────────────── Traceback (most recent call last) ─────────────────────────────────────────────────╮
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/api/validate.py:48 in post_validate_node │
│ │
│ 45 │ │ # validate node │
│ 46 │ │ node = graph.get_node(node_id) │
│ 47 │ │ if node is not None: │
│ ❱ 48 │ │ │ _ = node.build() │
│ 49 │ │ │ return str(node.params) │
│ 50 │ │ raise Exception(f"Node {node_id} not found") │
│ 51 │ except Exception as e: │
│ │
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/graph/nodes.py:34 in build │
│ │
│ 31 │ │ │ for chain_node in self.chains: │
│ 32 │ │ │ │ chain_node.build(tools=self.tools) │
│ 33 │ │ │ │
│ ❱ 34 │ │ │ self._build() │
│ 35 │ │ │
│ 36 │ │ #! Cannot deepcopy VectorStore, VectorStoreRouter, or SQL agents │
│ 37 │ │ if self.node_type in ["VectorStoreAgent", "VectorStoreRouterAgent", "SQLAgent"]: │
│ │
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/graph/base.py:161 in _build │
│ │
│ 158 │ │ │ │ if value == self: │
│ 159 │ │ │ │ │ del self.params[key] │
│ 160 │ │ │ │ │ continue │
│ ❱ 161 │ │ │ │ result = value.build() │
│ 162 │ │ │ │ # If the key is "func", then we need to use the run method │
│ 163 │ │ │ │ if key == "func": │
│ 164 │ │ │ │ │ if not isinstance(result, types.FunctionType): │
│ │
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/graph/base.py:207 in build │
│ │
│ 204 │ │
│ 205 │ def build(self, force: bool = False) -> Any: │
│ 206 │ │ if not self._built or force: │
│ ❱ 207 │ │ │ self._build() │
│ 208 │ │ │
│ 209 │ │ #! Deepcopy is breaking for vectorstores │
│ 210 │ │ if self.base_type in [ │
│ │
│ /home//dev/python/ai/langfl/.venv/lib/python3.10/site-packages/langflow/graph/base.py:196 in _build │
│ │
│ 193 │ │ │ │ params=self.params, │
│ 194 │ │ │ ) │
│ 195 │ │ except Exception as exc: │
│ ❱ 196 │ │ │ raise ValueError( │
│ 197 │ │ │ │ f"Error building node {self.node_type}: {str(exc)}" │
│ 198 │ │ │ ) from exc │
│ 199 │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
ValueError: Error building node ChatOpenAI: 1 validation error for ChatOpenAI
__root__
Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a
named parameter. (type=value_error)
Same here, as well as "INFO: 127.0.0.1:58114 - "POST /validate/node/dndnode_85 HTTP/1.1" 500 Internal Server Error" When I put the openAI key in the LLM box, then the erros stop, but when I try to chat nothing happens and the terminal goes in a non-stop printing of "WARNING: Invalid HTTP request received.".
Perhaps comparing with "production" will make it compatible with local run. But when I run with NODE_ENV=development I'm still having issues.
With 0.68 release, the chat is working for me now, without the "invalid HTTP request received" in terminal. The rest is the same.
@ATL64 Could you point out another specific issue apart from reloading past flows?
@ogabrielluiz Not that I can see. Haven't used the app much today though.
still getting a lot of errors
What errors?
OP posted a terminal output of python errors.
have a read of what its' telling you:
Did not find openai_api_key, please add an environment variable `OPENAI_API_KEY` which contains it, or pass `openai_api_key` as a named parameter.
so I launch it like this:
start.sh
OPENAI_API_KEY=paste-your-key-here \
python -m langflow
then make that executable:
chmod +x ./start.sh
then anytime you want to launch it:
./start.sh
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.