licos-agent-runtime 0.2.7__tar.gz → 0.2.8__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/PKG-INFO +1 -1
  2. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/pyproject.toml +1 -1
  3. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/workflow_canvas.py +1 -1
  4. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_workflow_protocol.py +34 -0
  5. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/.gitignore +0 -0
  6. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/__init__.py +0 -0
  7. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/__main__.py +0 -0
  8. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/agent_canvas.py +0 -0
  9. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/agent_config.py +0 -0
  10. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/app.py +0 -0
  11. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/attachments.py +0 -0
  12. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/context.py +0 -0
  13. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/errors.py +0 -0
  14. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/graph_loader.py +0 -0
  15. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/logging.py +0 -0
  16. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/openai.py +0 -0
  17. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/parser.py +0 -0
  18. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/payload.py +0 -0
  19. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/run_config.py +0 -0
  20. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/service.py +0 -0
  21. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/stream_protocol.py +0 -0
  22. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/stream_runner.py +0 -0
  23. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/telemetry.py +0 -0
  24. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/src/licos_agent_runtime/workflow_protocol.py +0 -0
  25. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_agent_config.py +0 -0
  26. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_context.py +0 -0
  27. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_graph_loader.py +0 -0
  28. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_parser.py +0 -0
  29. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_payload.py +0 -0
  30. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_service_stream_protocol.py +0 -0
  31. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_stream_protocol.py +0 -0
  32. {licos_agent_runtime-0.2.7 → licos_agent_runtime-0.2.8}/tests/test_stream_runner.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: licos-agent-runtime
3
- Version: 0.2.7
3
+ Version: 0.2.8
4
4
  Summary: LICOS Python agent runtime for LangGraph/LangChain projects
5
5
  Requires-Python: >=3.10
6
6
  Requires-Dist: fastapi<1,>=0.121
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "licos-agent-runtime"
7
- version = "0.2.7"
7
+ version = "0.2.8"
8
8
  description = "LICOS Python agent runtime for LangGraph/LangChain projects"
9
9
  requires-python = ">=3.10"
10
10
  dependencies = [
@@ -248,7 +248,7 @@ def _dependencies(metadata: dict[str, Any]) -> dict[str, Any]:
248
248
  if isinstance(raw, dict):
249
249
  return {key: value for key, value in raw.items() if value not in (None, "", [], {})}
250
250
  result: dict[str, Any] = {}
251
- llm_config = metadata.get("llm_config")
251
+ llm_config = metadata.get("llm_cfg") or metadata.get("llm_config")
252
252
  if isinstance(llm_config, str) and llm_config.strip():
253
253
  result["llm_config"] = [llm_config.strip()]
254
254
  elif isinstance(llm_config, list):
@@ -94,6 +94,40 @@ class WorkflowProtocolTests(unittest.TestCase):
94
94
  self.assertIn("#L", nodes[1]["script"]["content"])
95
95
  self.assertEqual(nodes[2]["definition"]["inputs"]["properties"]["answer"]["type"], "string")
96
96
 
97
+ def test_workflow_canvas_maps_llm_cfg_to_llm_config_dependency(self):
98
+ def analyze_topic(state):
99
+ return {"answer": state.get("topic", "")}
100
+
101
+ class Node:
102
+ metadata = {
103
+ "title": "智能分析",
104
+ "type": "agent",
105
+ "llm_cfg": "config/analyze_topic_cfg.json",
106
+ }
107
+ data = analyze_topic
108
+
109
+ class RawGraph:
110
+ nodes = {"analyze_topic": Node()}
111
+
112
+ class Graph:
113
+ def get_graph(self):
114
+ return RawGraph()
115
+
116
+ class Service(GraphService):
117
+ def _get_graph(self, ctx=None):
118
+ del ctx
119
+ return Graph()
120
+
121
+ with patch("licos_agent_runtime.service.is_agent_project", return_value=False):
122
+ result = Service().agent_canvas()
123
+
124
+ nodes = json.loads(result["data"]["data"])["nodes"]
125
+ self.assertEqual(nodes[1]["type"], "agent")
126
+ self.assertEqual(
127
+ nodes[1]["definition"]["info"]["dependencies"]["llm_config"],
128
+ ["config/analyze_topic_cfg.json"],
129
+ )
130
+
97
131
  def test_run_node_executes_node_callable_directly(self):
98
132
  def generate_answer(state):
99
133
  return {"answer": state.get("topic", "")}