Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
bb7b88c
add new models enums
Jan 20, 2026
8784ca4
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 2, 2026
4536223
add gpt 5 family support
Feb 2, 2026
615702a
upd default configs
Feb 2, 2026
9e98dcd
change default model back to 4.1
Feb 3, 2026
b48cf3b
set default to 5.1
Feb 3, 2026
3fe8ff6
change default to 5.2
Feb 3, 2026
b5ee249
upd defaults llms for hybrid search
Feb 3, 2026
e5f044c
upd default llms for hybrid search
Feb 3, 2026
a9960ad
switch hybrid indexing to minimal effort
Feb 4, 2026
d418829
set temp to 1 for other reasoning levels
Feb 4, 2026
2589a92
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 5, 2026
bbdcdc8
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 12, 2026
2531312
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 19, 2026
ac24314
remove unused import
Feb 19, 2026
eccd61c
Potential fix for code scanning alert no. 48: Clear-text logging of s…
bahdan111 Feb 19, 2026
7a565e4
reformat
Feb 19, 2026
bd3f8ea
Merge branch '92-switch-to-gpt5-models' of https://github.com/epam/st…
Feb 19, 2026
6d39a70
reformat
Feb 19, 2026
1b431d9
add temperature to configs
Feb 19, 2026
0c48f10
add seed to configs
Feb 19, 2026
dc235d9
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 19, 2026
5c062be
change default model back to 4.1
Feb 23, 2026
6a47f43
fix: add temperature for indexing models
Feb 23, 2026
03f6b58
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 24, 2026
65b3233
Merge branch 'development' into 92-switch-to-gpt5-models
Feb 27, 2026
6b47b9b
Merge branch 'development' into 92-switch-to-gpt5-models
Mar 3, 2026
8415cdd
upd dial rag state model
Mar 5, 2026
be1a530
upd base rag state
Mar 5, 2026
dbfa009
Merge branch 'development' into 92-switch-to-gpt5-models
Mar 6, 2026
9d2dcf0
Merge branch 'development' into 92-switch-to-gpt5-models
Mar 26, 2026
5de1029
Merge branch 'development' into 92-switch-to-gpt5-models
Mar 30, 2026
0e659c6
add gpt 5.4 model enums
Mar 30, 2026
7a09009
add fix to callback
Mar 30, 2026
73eb3a7
Merge branch '243-model-pricing-with-allias' into 92-switch-to-gpt5-m…
Mar 30, 2026
883a993
increase timeout
Mar 31, 2026
980b67c
add cascade ondelete
Apr 1, 2026
e9fc7d5
add migration
Apr 1, 2026
484263b
Merge branch '253-channel-import-fails' into 92-switch-to-gpt5-models
Apr 1, 2026
1748758
upd alembic version
Apr 1, 2026
fbc4a75
Merge branch 'development' into 92-switch-to-gpt5-models
Apr 2, 2026
7228c92
Merge branch 'development' into 92-switch-to-gpt5-models
Apr 7, 2026
d6fc10e
feat: add new gpt5.5 model's enum
May 18, 2026
615eac1
Merge branch 'development' into 92-switch-to-gpt5-models
Azamat0315277 May 18, 2026
4f12137
fix: upd model name
May 19, 2026
e4ba152
Merge branch 'development' into 92-switch-to-gpt5-models
Azamat0315277 May 19, 2026
c3c9fb8
Merge branch 'development' into 92-switch-to-gpt5-models
Azamat0315277 May 25, 2026
e32177e
Merge branch 'development' into 92-switch-to-gpt5-models
Azamat0315277 May 26, 2026
2f1e33e
Merge branch 'development' into 92-switch-to-gpt5-models
Azamat0315277 May 28, 2026
d537b40
Merge branch 'development' into 92-switch-to-gpt5-models
Azamat0315277 May 29, 2026
93c0b52
Merge branch 'development' into 92-switch-to-gpt5-models
navalnica Jun 3, 2026
95ead44
Merge branch 'development' into 92-switch-to-gpt5-models
navalnica Jun 3, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions configurations/clients/sample/channels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,18 @@ channels:
datasets, as it contains data directly provided by national statistical
agencies.
llm_model_config:
deployment: "gpt-4.1-2025-04-14"
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
out_of_scope:
llm_model_config:
deployment: "gpt-4.1-2025-04-14"
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
use_general_topics_blacklist: true
domain: "Statistics, economics and SDMX."
token_usage:
Expand Down
59 changes: 42 additions & 17 deletions configurations/clients/sample/tools.yaml
Original file line number Diff line number Diff line change
@@ -1,29 +1,54 @@
_available_datasets_call_id: &available_datasets_call_id "call_EBJJeaOMKeCzm8h378ubURQN"
_available_terms_tool_call_id: &availableTermsCallId "call_EBJJeaOMKeCzm8h378ubU003"
_data_query_gpt_41_models: &data-query-gpt-41-models
_data_query_gpt_5_models: &data-query-gpt-5-models
datasetsSelectionModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
dimensionsSelectionModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
indicatorsSelectionModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
incompleteQueriesModelConfig:
deployment: "gpt-4.1-2025-04-14"
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
groupExpanderModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
namedEntitiesModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
queryNormalizationModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
timePeriodModelConfig:
deployment: "gpt-4.1-2025-04-14"
temperature: 0.0
deployment: "gpt-5.2-2025-12-11"
reasoningEffort: "none"
verbosity: "low"
temperature: 1
seed: null
_relevancy_prompts: &relevancy_prompts
systemMessage: |-
You are an expert in statistical indicators.
Expand Down Expand Up @@ -121,7 +146,7 @@ tools:
namedEntitiesToRemove: ["Country/Reference area", "Counterpart area/country"]
prompts:
relevancyPrompts: *relevancy_prompts
llmModels: *data-query-gpt-41-models
llmModels: *data-query-gpt-5-models
attachments:
customTable:
enabledStr: "True"
Expand Down
2 changes: 1 addition & 1 deletion statgpt/admin/settings/background_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ class BackgroundTasksSettings(BaseSettings):

max_concurrent: int = Field(5, description="Maximum number of concurrent background tasks")
task_timeout: float | None = Field(
1800.0, description="Timeout in seconds for a single background task (None to disable)"
3600.0, description="Timeout in seconds for a single background task (None to disable)"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is this needed?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's fix to timeouts we had during indexing

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Fedir-Yatsenko are you okay with this? looks like it affects all background jobs, not only indexing ones

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, this is okay

)
2 changes: 1 addition & 1 deletion statgpt/app/schemas/file_rags/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

class BaseRagState(ToolMessageState):
type: ToolTypes = ToolTypes.FILE_RAG
version: RAGVersion
version: RAGVersion = RAGVersion.DIAL
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we set this default?


response: str = "" # This is not needed since we have content field
answered_by: str = ""
16 changes: 13 additions & 3 deletions statgpt/common/schemas/data_query_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from pydantic import Field, PositiveInt, TypeAdapter, field_validator, model_validator
from pydantic_core.core_schema import FieldValidationInfo

from statgpt.common.config import LLMModelsEnum
from statgpt.common.config import LLMModelsEnum, ReasoningEffortEnum, VerbosityEnum
from statgpt.common.config.utils import replace_env

from .base import BaseYamlModel, SystemUserPrompt
Expand Down Expand Up @@ -175,11 +175,21 @@ class HybridSearchConfig(BaseYamlModel):

normalize_model_config: LLMModelConfig = Field(
description="LLM Model used for normalization",
default_factory=lambda: LLMModelConfig(deployment=LLMModelsEnum.GPT_4_1_MINI_2025_04_14),
default_factory=lambda: LLMModelConfig(
deployment=LLMModelsEnum.GPT_5_MINI_2025_08_07,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can try gpt-5.4-mini

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

for sure

reasoning_effort=ReasoningEffortEnum.MINIMAL,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why not reasoning=none?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there is no none reasoning for mini

verbosity=VerbosityEnum.LOW,
temperature=1,
),
)
harmonize_model_config: LLMModelConfig = Field(
description="LLM Model used for harmonization",
default_factory=lambda: LLMModelConfig(deployment=LLMModelsEnum.GPT_4_1_MINI_2025_04_14),
default_factory=lambda: LLMModelConfig(
deployment=LLMModelsEnum.GPT_5_MINI_2025_08_07,
reasoning_effort=ReasoningEffortEnum.MINIMAL,
verbosity=VerbosityEnum.LOW,
temperature=1,
Comment on lines +188 to +191
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same. can try gpt-5.4-mini and none reasoning

),
)

# ~~~~~~~~~~ Search config ~~~~~~~~~~
Expand Down
17 changes: 16 additions & 1 deletion statgpt/common/settings/langchain.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,12 @@
from pydantic import Field
from pydantic_settings import BaseSettings, SettingsConfigDict

from statgpt.common.config.llm_models import EmbeddingModelsEnum, LLMModelsEnum
from statgpt.common.config.llm_models import (
EmbeddingModelsEnum,
LLMModelsEnum,
ReasoningEffortEnum,
VerbosityEnum,
)


class LangChainSettings(BaseSettings):
Expand Down Expand Up @@ -38,6 +43,16 @@ class LangChainSettings(BaseSettings):
description="Default seed for reproducible outputs",
)

default_reasoning_effort: ReasoningEffortEnum | None = Field(
default=ReasoningEffortEnum.NONE,
description="Default reasoning effort for GPT-5 models (none/minimal/low/medium/high/xhigh)",
)

default_verbosity: VerbosityEnum | None = Field(
default=VerbosityEnum.LOW,
description="Default verbosity for GPT-5 models (low/medium/high). None means use model default.",
)

Comment on lines +46 to +55
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are those ever used?

# Debugging settings
verbose: bool = Field(default=False, description="Enable verbose mode for LangChain")

Expand Down
17 changes: 9 additions & 8 deletions statgpt/common/utils/callbacks.py
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all changes to this whole file look stale. need to remove them

Original file line number Diff line number Diff line change
Expand Up @@ -124,29 +124,30 @@ class TokenUsageByModelsCallback(AsyncCallbackHandler):

def __init__(self) -> None:
super().__init__()
self._run_2_deployment: dict[UUID, str] = {}
self._deployment_ids: dict[UUID, str] = {}

async def on_chat_model_start(
def on_chat_model_start( # type: ignore[override]
self,
serialized: dict[str, t.Any],
messages: list[list[t.Any]],
*,
run_id: UUID,
**kwargs: t.Any,
) -> None:
try:
self._run_2_deployment[run_id] = serialized['kwargs']['deployment_name']
except (KeyError, TypeError):
pass
if serialized['id'][-1] == 'AzureChatOpenAI':
try:
self._deployment_ids[run_id] = serialized['kwargs']['deployment_name']
except (KeyError, TypeError):
pass

async def on_llm_end(
def on_llm_end( # type: ignore[override]
self,
response: LLMResult,
*,
run_id: UUID,
**kwargs: t.Any,
) -> None:
deployment_id = self._run_2_deployment.pop(run_id, None)
deployment_id = self._deployment_ids.pop(run_id, None)

try:
generation = response.generations[0][0]
Expand Down
14 changes: 4 additions & 10 deletions statgpt/common/utils/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,10 @@ def get_chat_model(
params.update(model_config.model_dump(mode="json", exclude_none=True, exclude={"deployment"}))

if model_config.deployment.is_gpt_41_family:
callback = BrokenResponseInterceptor(regex_pattern=r'\s{5,}')
params.setdefault('callbacks', []).append(callback)
callback = BrokenResponseInterceptor(regex_pattern=r"\s{5,}")
params.setdefault("callbacks", []).append(callback)

api_key_log = f'{api_key.get_secret_value()[:3]}*****{api_key.get_secret_value()[-2:]}'
logger.info(
f'creating langchain LLM with the following params: {params}, Api key: {api_key_log}'
)
logger.info(f"creating langchain LLM with the following params: {params}")
return AzureChatOpenAI.model_validate(params)


Expand All @@ -78,8 +75,5 @@ def get_embeddings_model(
max_retries=10,
api_key=api_key, # since we use SecretStr, it won't be logged
)
api_key_log = f'{api_key.get_secret_value()[:3]}*****{api_key.get_secret_value()[-2:]}'
logger.info(
f'creating langchain embeddings with the following params: {params}, Api key: {api_key_log}'
)
logger.info(f"creating langchain embeddings with the following params: {params}")
return AzureOpenAIEmbeddings.model_validate(params)
Loading