Skip to content

Commit 8d5a1be

Browse files
authored
fix: Cannot use files in the user inputs. (langgenius#11112)
1 parent 90d5765 commit 8d5a1be

File tree

5 files changed

+12
-6
lines changed

5 files changed

+12
-6
lines changed

api/core/app/apps/advanced_chat/app_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,9 @@ def generate(
127127
conversation_id=conversation.id if conversation else None,
128128
inputs=conversation.inputs
129129
if conversation
130-
else self._prepare_user_inputs(user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id),
130+
else self._prepare_user_inputs(
131+
user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id
132+
),
131133
query=query,
132134
files=file_objs,
133135
parent_message_id=args.get("parent_message_id") if invoke_from != InvokeFrom.SERVICE_API else UUID_NIL,

api/core/app/apps/agent_chat/app_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,9 @@ def generate(
134134
conversation_id=conversation.id if conversation else None,
135135
inputs=conversation.inputs
136136
if conversation
137-
else self._prepare_user_inputs(user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id),
137+
else self._prepare_user_inputs(
138+
user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id
139+
),
138140
query=query,
139141
files=file_objs,
140142
parent_message_id=args.get("parent_message_id") if invoke_from != InvokeFrom.SERVICE_API else UUID_NIL,

api/core/app/apps/chat/app_generator.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,9 @@ def generate(
132132
conversation_id=conversation.id if conversation else None,
133133
inputs=conversation.inputs
134134
if conversation
135-
else self._prepare_user_inputs(user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id),
135+
else self._prepare_user_inputs(
136+
user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id
137+
),
136138
query=query,
137139
files=file_objs,
138140
parent_message_id=args.get("parent_message_id") if invoke_from != InvokeFrom.SERVICE_API else UUID_NIL,

api/core/app/apps/completion/app_generator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ def generate(
114114
model_conf=ModelConfigConverter.convert(app_config),
115115
file_upload_config=file_extra_config,
116116
inputs=self._prepare_user_inputs(
117-
user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.id
117+
user_inputs=inputs, variables=app_config.variables, tenant_id=app_model.tenant_id
118118
),
119119
query=query,
120120
files=file_objs,

api/models/account.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ def current_tenant(self, value: "Tenant"):
5656
self._current_tenant = tenant
5757

5858
@property
59-
def current_tenant_id(self):
60-
return self._current_tenant.id
59+
def current_tenant_id(self) -> str | None:
60+
return self._current_tenant.id if self._current_tenant else None
6161

6262
@current_tenant_id.setter
6363
def current_tenant_id(self, value: str):

0 commit comments

Comments
 (0)