@@ -92,8 +92,31 @@ class RequestAdapter:
|
||||
|
||||
def _transform_tools_for_responses(self, tools: Any) -> Any:
|
||||
out: List[Dict[str, Any]] = []
|
||||
for tool in tools:
|
||||
if not isinstance(tools, list):
|
||||
current_app.logger.debug(
|
||||
"Skipping tool transformation because tools payload is not a list: %r",
|
||||
tools,
|
||||
)
|
||||
return out
|
||||
|
||||
for idx, tool in enumerate(tools):
|
||||
if not isinstance(tool, dict):
|
||||
current_app.logger.warning(
|
||||
"Skipping tool at index %s because it is not a dict (got %s).",
|
||||
idx,
|
||||
type(tool).__name__,
|
||||
)
|
||||
continue
|
||||
|
||||
function = tool.get("function")
|
||||
if not isinstance(function, dict):
|
||||
current_app.logger.warning(
|
||||
"Skipping tool at index %s because function payload is missing or invalid: %r",
|
||||
idx,
|
||||
function,
|
||||
)
|
||||
continue
|
||||
|
||||
transformed: Dict[str, Any] = {
|
||||
"type": "function",
|
||||
"name": function.get("name"),
|
||||
|
||||
+1
-12
@@ -6,17 +6,6 @@ x-default-volumes: &default_volumes
|
||||
- ./:/app
|
||||
|
||||
services:
|
||||
flask-dev:
|
||||
build:
|
||||
context: .
|
||||
target: development
|
||||
args:
|
||||
<<: *build_args
|
||||
image: "app-development"
|
||||
ports:
|
||||
- "8080:5000"
|
||||
<<: *default_volumes
|
||||
|
||||
flask-prod:
|
||||
build:
|
||||
context: .
|
||||
@@ -25,7 +14,7 @@ services:
|
||||
<<: *build_args
|
||||
image: "app-production"
|
||||
ports:
|
||||
- "8080:5000"
|
||||
- "9090:5000"
|
||||
environment:
|
||||
FLASK_ENV: production
|
||||
FLASK_DEBUG: 0
|
||||
|
||||
Reference in New Issue
Block a user