MCPcopy Create free account
hub / github.com/pgadmin-org/pgadmin4 / _convert_tools

Method _convert_tools

web/pgadmin/llm/providers/docker.py:208–220  ·  view source on GitHub ↗

Convert Tool objects to OpenAI API format.

(self, tools: list[Tool])

Source from the content-addressed store, hash-verified

206 return result
207
208 def _convert_tools(self, tools: list[Tool]) -> list[dict]:
209 """Convert Tool objects to OpenAI API format."""
210 return [
211 {
212 'type': 'function',
213 'function': {
214 'name': tool.name,
215 'description': tool.description,
216 'parameters': tool.parameters
217 }
218 }
219 for tool in tools
220 ]
221
222 def _make_request(self, payload: dict) -> dict:
223 """Make an HTTP request to the Docker Model Runner API."""

Callers 2

chatMethod · 0.95
chat_streamMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected