1111
1212import mellea
1313from cli .serve .models import ChatMessage
14+ from mellea .backends import ModelOption
1415from mellea .core import ModelOutputThunk , Requirement
1516from mellea .core .base import AbstractMelleaTool
1617from mellea .stdlib .context import ChatContext
@@ -140,9 +141,9 @@ def serve(
140141
141142 # Extract tools from model_options if provided
142143 tools = None
143- if model_options and "@@@tools@@@" in model_options :
144+ if model_options and ModelOption . TOOLS in model_options :
144145 # Convert OpenAI tool format to Mellea tool format
145- openai_tools = model_options ["@@@tools@@@" ]
146+ openai_tools = model_options [ModelOption . TOOLS ]
146147 tools = {}
147148 for tool_def in openai_tools :
148149 tool_name = tool_def ["function" ]["name" ]
@@ -152,7 +153,7 @@ def serve(
152153 # Build model options with tools
153154 final_model_options = model_options or {}
154155 if tools :
155- final_model_options ["@@@tools@@@" ] = tools
156+ final_model_options [ModelOption . TOOLS ] = tools
156157
157158 # Use instruct to generate response with potential tool calls
158159 result = session .instruct (
@@ -170,7 +171,7 @@ def serve(
170171
171172 # Simulate tool definitions being passed
172173 test_model_options = {
173- "@@@tools@@@" : [weather_tool .as_json_tool , stock_price_tool .as_json_tool ]
174+ ModelOption . TOOLS : [weather_tool .as_json_tool , stock_price_tool .as_json_tool ]
174175 }
175176
176177 response = serve (input = test_messages , model_options = test_model_options )
0 commit comments