__pycache__/customer_support_environment.cpython-313.pyc ADDED
Binary file (10.4 kB). View file
 
__pycache__/data_loader.cpython-313.pyc CHANGED
Binary files a/__pycache__/data_loader.cpython-313.pyc and b/__pycache__/data_loader.cpython-313.pyc differ
 
__pycache__/kb.cpython-313.pyc CHANGED
Binary files a/__pycache__/kb.cpython-313.pyc and b/__pycache__/kb.cpython-313.pyc differ
 
__pycache__/tasks.cpython-313.pyc CHANGED
Binary files a/__pycache__/tasks.cpython-313.pyc and b/__pycache__/tasks.cpython-313.pyc differ
 
customer_support_environment.py CHANGED
@@ -87,7 +87,8 @@ class CustomerSupportEnvironment(Environment[SupportAction, SupportObservation,
87
  ) -> SupportObservation:
88
  del timeout_s, kwargs
89
  if self._expected is None:
90
- raise RuntimeError("Call reset before step")
 
91
  if self._done:
92
  return self._make_observation(reward=0.0, done=True, feedback="Episode already done")
93
 
 
87
  ) -> SupportObservation:
88
  del timeout_s, kwargs
89
  if self._expected is None:
90
+ # HTTP mode can be stateless across requests; initialize lazily.
91
+ self.reset()
92
  if self._done:
93
  return self._make_observation(reward=0.0, done=True, feedback="Episode already done")
94
 
server/customer_support_environment.py CHANGED
@@ -87,7 +87,8 @@ class CustomerSupportEnvironment(Environment[SupportAction, SupportObservation,
87
  ) -> SupportObservation:
88
  del timeout_s, kwargs
89
  if self._expected is None:
90
- raise RuntimeError("Call reset before step")
 
91
  if self._done:
92
  return self._make_observation(reward=0.0, done=True, feedback="Episode already done")
93
 
 
87
  ) -> SupportObservation:
88
  del timeout_s, kwargs
89
  if self._expected is None:
90
+ # HTTP mode can be stateless across requests; initialize lazily.
91
+ self.reset()
92
  if self._done:
93
  return self._make_observation(reward=0.0, done=True, feedback="Episode already done")
94
 
test_api_smoke.py CHANGED
@@ -1,11 +1,15 @@
1
  import asyncio
 
2
 
3
  from client import CustomerSupportEnvClient
4
  from models import SupportAction
5
 
6
 
 
 
 
7
  async def run_episode(difficulty: str, index: int) -> dict:
8
- env = CustomerSupportEnvClient(base_url="http://127.0.0.1:8000")
9
  await env.connect()
10
  reset_result = await env.reset(difficulty=difficulty, index=index)
11
 
 
1
  import asyncio
2
+ import os
3
 
4
  from client import CustomerSupportEnvClient
5
  from models import SupportAction
6
 
7
 
8
+ BASE_URL = os.getenv("TARGET_BASE_URL", "http://127.0.0.1:8000")
9
+
10
+
11
  async def run_episode(difficulty: str, index: int) -> dict:
12
+ env = CustomerSupportEnvClient(base_url=BASE_URL)
13
  await env.connect()
14
  reset_result = await env.reset(difficulty=difficulty, index=index)
15