Skip to content
9 changes: 8 additions & 1 deletion controller/attribute/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,6 @@ def prepare_llm_response_code(
llm_playground_config: Union[Dict[str, Any], None] = None,
llm_ac_cache_access_link: Union[str, None] = None,
llm_ac_cache_file_upload_link: Union[str, None] = None,
num_workers: int = 100,
max_api_call_retries: int = 5,
retry_sleep_seconds: int = 5,
) -> str:
Expand Down Expand Up @@ -294,6 +293,14 @@ async def ac(record):
)
validate_llm_config(llm_config=llm_config)

num_workers = 50
if (
llm_config is not None
and enums.LLMProvider.from_string(llm_config.get("llmIdentifier", "Open ai"))
== enums.LLMProvider.AZURE_FOUNDRY
):
num_workers = 25

try:
llm_config_mapping = {
"@@API_KEY@@": llm_config["apiKey"],
Expand Down
2 changes: 1 addition & 1 deletion controller/misc/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def finalize_customer_buttons(
for e in buttons:
e[key_name] = name_lookup[str(e[key])]
e[key_name] = (
(e[key_name]["first"] + " " + e[key_name]["last"])
(e[key_name]["first"] or "" + " " + e[key_name]["last"] or "")
if e[key_name]
else "Unknown"
)
Expand Down
5 changes: 5 additions & 0 deletions controller/project/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,11 @@ def get_all_projects_by_user(organization_id) -> List[Project]:
else:
p["num_data_scale_uploaded"] = record.get_count_scale_uploaded(p["id"])

p["is_integration_project"] = any(
p["name"].startswith(f"[{integration_type.value}]")
for integration_type in enums.CognitionIntegrationType
)

del p["created_by"]

return project_dicts
Expand Down
7 changes: 5 additions & 2 deletions fast_api/routes/embedding.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from controller.auth import manager as auth_manager
from controller.embedding.connector import collection_on_qdrant
from submodules.model.enums import TaskType
from submodules.model.business_objects import embedding
from submodules.model.business_objects import embedding as embedding_bo
from submodules.model.cognition_objects import environment_variable as env_var_db_bo
from submodules.model.util import sql_alchemy_to_dict
from util import notification, spacy_util
Expand Down Expand Up @@ -51,13 +51,16 @@ def language_models(request: Request) -> List:
dependencies=[Depends(auth_manager.check_project_access_dep)],
)
def get_embeddings(project_id: str) -> List:
embeddings_extended = embedding.get_all_embeddings_by_project_id_extended(
embeddings_extended = embedding_bo.get_all_embeddings_by_project_id_extended(
project_id
)
data = [
{
**sql_alchemy_to_dict(embedding),
"on_qdrant": collection_on_qdrant(project_id, embedding["id"]),
"count": sql_alchemy_to_dict(
embedding_bo.get_tensor_count(embedding["id"])
),
}
for embedding in embeddings_extended
]
Expand Down
2 changes: 1 addition & 1 deletion submodules/model