mirror of
https://github.com/agentuniverse-ai/agentUniverse.git
synced 2026-02-09 01:59:19 +08:00
1028-1
This commit is contained in:
@@ -14,7 +14,10 @@ class MockOutPut:
|
||||
self.__output = output
|
||||
|
||||
def to_json_str(self) -> str:
|
||||
return json.dumps(self.__output, ensure_ascii=False)
|
||||
try:
|
||||
return json.dumps(self.__output, ensure_ascii=False)
|
||||
except (TypeError, ValueError) as e:
|
||||
raise ValueError(f"Failed to serialize output to JSON: {e}")"
|
||||
|
||||
|
||||
class MockAgent:
|
||||
|
||||
@@ -24,5 +24,5 @@ class ServiceManager:
|
||||
def get_instance_obj(self, service_code: str):
|
||||
service_base = self.__service_map.get(service_code)
|
||||
if service_base is None:
|
||||
raise Exception(f"Service {service_code} not found.")
|
||||
raise ValueError(f"Service {service_code} not found.")
|
||||
return service_base
|
||||
|
||||
Reference in New Issue
Block a user