mirror of
https://git.mirrors.martin98.com/https://github.com/langgenius/dify.git
synced 2025-08-14 00:25:57 +08:00
Langfuse view button (#7684)
This commit is contained in:
parent
88730906ec
commit
e7afee1176
@ -21,7 +21,6 @@ class LangfuseConfig(BaseTracingConfig):
|
|||||||
"""
|
"""
|
||||||
public_key: str
|
public_key: str
|
||||||
secret_key: str
|
secret_key: str
|
||||||
project_key: str
|
|
||||||
host: str = 'https://api.langfuse.com'
|
host: str = 'https://api.langfuse.com'
|
||||||
|
|
||||||
@field_validator("host")
|
@field_validator("host")
|
||||||
|
@ -26,16 +26,15 @@ class OpsService:
|
|||||||
decrypt_tracing_config = OpsTraceManager.decrypt_tracing_config(
|
decrypt_tracing_config = OpsTraceManager.decrypt_tracing_config(
|
||||||
tenant_id, tracing_provider, trace_config_data.tracing_config
|
tenant_id, tracing_provider, trace_config_data.tracing_config
|
||||||
)
|
)
|
||||||
|
new_decrypt_tracing_config = OpsTraceManager.obfuscated_decrypt_token(tracing_provider, decrypt_tracing_config)
|
||||||
|
|
||||||
if tracing_provider == "langfuse" and (
|
if tracing_provider == "langfuse" and (
|
||||||
"project_key" not in decrypt_tracing_config or not decrypt_tracing_config.get("project_key")
|
"project_key" not in decrypt_tracing_config or not decrypt_tracing_config.get("project_key")
|
||||||
):
|
):
|
||||||
project_key = OpsTraceManager.get_trace_config_project_key(decrypt_tracing_config, tracing_provider)
|
project_key = OpsTraceManager.get_trace_config_project_key(decrypt_tracing_config, tracing_provider)
|
||||||
decrypt_tracing_config["project_key"] = project_key
|
new_decrypt_tracing_config.update({"project_key": project_key})
|
||||||
|
|
||||||
decrypt_tracing_config = OpsTraceManager.obfuscated_decrypt_token(tracing_provider, decrypt_tracing_config)
|
|
||||||
|
|
||||||
trace_config_data.tracing_config = decrypt_tracing_config
|
|
||||||
|
|
||||||
|
trace_config_data.tracing_config = new_decrypt_tracing_config
|
||||||
return trace_config_data.to_dict()
|
return trace_config_data.to_dict()
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -79,7 +78,7 @@ class OpsService:
|
|||||||
# get tenant id
|
# get tenant id
|
||||||
tenant_id = db.session.query(App).filter(App.id == app_id).first().tenant_id
|
tenant_id = db.session.query(App).filter(App.id == app_id).first().tenant_id
|
||||||
tracing_config = OpsTraceManager.encrypt_tracing_config(tenant_id, tracing_provider, tracing_config)
|
tracing_config = OpsTraceManager.encrypt_tracing_config(tenant_id, tracing_provider, tracing_config)
|
||||||
if tracing_provider == "langfuse":
|
if tracing_provider == "langfuse" and project_key:
|
||||||
tracing_config["project_key"] = project_key
|
tracing_config["project_key"] = project_key
|
||||||
trace_config_data = TraceAppConfig(
|
trace_config_data = TraceAppConfig(
|
||||||
app_id=app_id,
|
app_id=app_id,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user