Skip to content

armgit / letta

Public Imported from GitHub
0

Platform for stateful agents: AI with advanced memory that can learn and self-improve over time.

feat: Add flag for TLS (#4865)

Matthew Zhou8395ec429ac3
diff --git a/letta/agents/temporal_agent.py b/letta/agents/temporal_agent.py
index 136170186..c28d1c33e 100644
--- a/letta/agents/temporal_agent.py
+++ b/letta/agents/temporal_agent.py
@@ -47,7 +47,7 @@ class TemporalAgent(BaseAgentV2):
settings.temporal_endpoint,
namespace=settings.temporal_namespace,
api_key=settings.temporal_api_key,
- tls=True, # This should be false for local runs
+ tls=settings.temporal_tls, # This should be false for local runs
)
workflow_input = WorkflowInputParams(
diff --git a/letta/server/rest_api/routers/v1/agents.py b/letta/server/rest_api/routers/v1/agents.py
index 24740ac4f..551881139 100644
--- a/letta/server/rest_api/routers/v1/agents.py
+++ b/letta/server/rest_api/routers/v1/agents.py
@@ -1499,7 +1499,7 @@ async def cancel_agent_run(
settings.temporal_endpoint,
namespace=settings.temporal_namespace,
api_key=settings.temporal_api_key,
- tls=True, # This should be false for local runs
+ tls=settings.temporal_tls, # This should be false for local runs
)
await client.cancel_workflow(run_id)
success = await server.job_manager.safe_update_job_status_async(
diff --git a/letta/server/rest_api/routers/v1/runs.py b/letta/server/rest_api/routers/v1/runs.py
index 6e0cc73c4..6e3de7d5e 100644
--- a/letta/server/rest_api/routers/v1/runs.py
+++ b/letta/server/rest_api/routers/v1/runs.py
@@ -120,7 +120,7 @@ async def retrieve_run(
settings.temporal_endpoint,
namespace=settings.temporal_namespace,
api_key=settings.temporal_api_key,
- tls=True, # This should be false for local runs
+ tls=settings.temporal_tls, # This should be false for local runs
)
handle = client.get_workflow_handle(run_id)
diff --git a/letta/settings.py b/letta/settings.py
index 6c4f3b705..8b9bf39ad 100644
--- a/letta/settings.py
+++ b/letta/settings.py
@@ -238,6 +238,7 @@ class Settings(BaseSettings):
redis_host: Optional[str] = Field(default=None, description="Host for Redis instance")
redis_port: Optional[int] = Field(default=6379, description="Port for Redis instance")
+ temporal_tls: bool = Field(default=True, description="If set to True, uses TLS. Set to False when developing locally.")
temporal_api_key: Optional[str] = Field(default=None, description="API key for Temporal instance")
temporal_namespace: Optional[str] = Field(default=None, description="Namespace for Temporal instance")
temporal_endpoint: Optional[str] = Field(default=None, description="Endpoint for Temporal instance")