I'm trying to set up the backend to work with an LM Studio model being served on the localhost:1234/V1 When I run export FLASK_APP=backend.main.py
flask run -p 8000
I get the following:
❯ export FLASK_APP=backend.main.py
flask run -p 8000
/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/langchain/init.py:34: UserWarning: Importing SQLDatabase from langchain root module is no longer supported. Please use langchain.utilities.SQLDatabase instead.
warnings.warn(
Traceback (most recent call last):
File "/Users/bard/anaconda3/envs/openagents/bin/flask", line 8, in
sys.exit(main())
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 1064, in main
cli.main()
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, *kwargs)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, args, kwargs)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return callback(*args, **kwargs)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 912, in run_command
raise e from None
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 898, in run_command
app = info.load_app()
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 219, in locate_app
import(module_name)
File "/Users/bard/Code/OpenAgents/backend/init.py", line 4, in
from backend.api import (
File "/Users/bard/Code/OpenAgents/backend/api/chat_copilot.py", line 5, in
from backend.api.file import _get_file_path_from_node
File "/Users/bard/Code/OpenAgents/backend/api/file.py", line 8, in
from backend.main import (
File "/Users/bard/Code/OpenAgents/backend/main.py", line 6, in
from backend.kernel_publisher import start_kernel_publisher
File "/Users/bard/Code/OpenAgents/backend/kernel_publisher.py", line 4, in
from backend.utils.utils import logger
File "/Users/bard/Code/OpenAgents/backend/utils/utils.py", line 14, in
from real_agents.adapters.data_model import (
File "/Users/bard/Code/OpenAgents/real_agents/adapters/data_model/init__.py", line 3, in
from real_agents.adapters.data_model.image import ImageDataModel
File "/Users/bard/Code/OpenAgents/real_agents/adapters/data_model/image.py", line 6, in
class ImageDataModel(DataModel):
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 104, in new
private_attributes = inspect_namespace(
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 370, in inspect_namespace
raise PydanticUserError(
pydantic.errors.PydanticUserError: A non-annotated attribute was detected: simple_filename = ''. All model fields require a type annotation; if simple_filename is not meant to be a field, you may be able to resolve this error by annotating it as a ClassVar or updating model_config['ignored_types'].
I'm trying to set up the backend to work with an LM Studio model being served on the localhost:1234/V1 When I run export FLASK_APP=backend.main.py flask run -p 8000 I get the following: ❯ export FLASK_APP=backend.main.py flask run -p 8000 /Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/langchain/init.py:34: UserWarning: Importing SQLDatabase from langchain root module is no longer supported. Please use langchain.utilities.SQLDatabase instead. warnings.warn( Traceback (most recent call last): File "/Users/bard/anaconda3/envs/openagents/bin/flask", line 8, in
sys.exit(main())
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 1064, in main
cli.main()
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 1078, in main
rv = self.invoke(ctx)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 1434, in invoke
return ctx.invoke(self.callback, ctx.params)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return __callback(*args, *kwargs)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/decorators.py", line 92, in new_func
return ctx.invoke(f, obj, args, kwargs)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/click/core.py", line 783, in invoke
return callback(*args, **kwargs)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 912, in run_command
raise e from None
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 898, in run_command
app = info.load_app()
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 309, in load_app
app = locate_app(import_name, name)
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/flask/cli.py", line 219, in locate_app
import(module_name)
File "/Users/bard/Code/OpenAgents/backend/init.py", line 4, in
from backend.api import (
File "/Users/bard/Code/OpenAgents/backend/api/chat_copilot.py", line 5, in
from backend.api.file import _get_file_path_from_node
File "/Users/bard/Code/OpenAgents/backend/api/file.py", line 8, in
from backend.main import (
File "/Users/bard/Code/OpenAgents/backend/main.py", line 6, in
from backend.kernel_publisher import start_kernel_publisher
File "/Users/bard/Code/OpenAgents/backend/kernel_publisher.py", line 4, in
from backend.utils.utils import logger
File "/Users/bard/Code/OpenAgents/backend/utils/utils.py", line 14, in
from real_agents.adapters.data_model import (
File "/Users/bard/Code/OpenAgents/real_agents/adapters/data_model/ init__.py", line 3, in
from real_agents.adapters.data_model.image import ImageDataModel
File "/Users/bard/Code/OpenAgents/real_agents/adapters/data_model/image.py", line 6, in
class ImageDataModel(DataModel):
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 104, in new
private_attributes = inspect_namespace(
File "/Users/bard/anaconda3/envs/openagents/lib/python3.10/site-packages/pydantic/_internal/_model_construction.py", line 370, in inspect_namespace
raise PydanticUserError(
pydantic.errors.PydanticUserError: A non-annotated attribute was detected:
simple_filename = ''
. All model fields require a type annotation; ifsimple_filename
is not meant to be a field, you may be able to resolve this error by annotating it as aClassVar
or updatingmodel_config['ignored_types']
.For further information visit https://errors.pydantic.dev/2.4/u/model-field-missing-annotation