Skip to content

FinceptTerminal is a modern finance application offering advanced market analytics, investment research, and economic data tools, designed for interactive exploration and data-driven decision-making in a user-friendly environment.

Merge branch 'main' of https://github.com/Fincept-Corporation/FinceptTerminal

tilakpatel22a7eeeddff1bc
diff --cc fincept-qt/src/python/PythonRunner.cpp
index 3359c6e83,0d8d96a29..d322b7151
--- a/fincept-qt/src/python/PythonRunner.cpp
+++ b/fincept-qt/src/python/PythonRunner.cpp
@@@ -10,8 -11,10 +11,11 @@@
#include <QFile>
#include <QFileInfo>
#include <QHash>
+ #include <QJsonArray>
+ #include <QJsonDocument>
+ #include <QJsonObject>
#include <QLatin1String>
+#include <QMetaObject>
#include <QProcessEnvironment>
#include <QStandardPaths>
#include <QStringList>
diff --cc fincept-qt/src/services/llm/LlmService.cpp
index c0e7d7bfb,555a3fb51..225ae1b5e
--- a/fincept-qt/src/services/llm/LlmService.cpp
+++ b/fincept-qt/src/services/llm/LlmService.cpp
@@@ -318,22 -335,19 +335,21 @@@ QString LlmService::get_endpoint_url()
// Custom base_url wins over hard-coded defaults.
if (!base_url_.isEmpty()) {
QString base = base_url_;
- if (base.endsWith('/'))
+ while (base.endsWith('/'))
base.chop(1);
-
const QString suffix = (p == "anthropic") ? QStringLiteral("/messages")
: QStringLiteral("/chat/completions");
- // If the base already includes the full endpoint, use it as-is.
+
+ // Already a full endpoint — use verbatim.
if (base.endsWith(suffix))
return base;
- // If the base already includes an API version segment (e.g. ".../v1"),
- // append only the suffix; otherwise add "/v1" first.
- static const QRegularExpression versioned(QStringLiteral("/v\\d+(beta)?$"));
- if (versioned.match(base).hasMatch())
+
+ // Base already includes a version segment (e.g. ".../v1", ".../v1beta") —
+ // append only the suffix. Otherwise inject the default "/v1".
+ static const QRegularExpression re(QStringLiteral("/v\\d+[a-zA-Z]*$"));
+ if (re.match(base).hasMatch())
return base + suffix;
- return base + "/v1" + suffix;
+ return base + QStringLiteral("/v1") + suffix;
}
if (p == "openai")