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

Function single_query

web/pgadmin/llm/chat.py:269–303  ·  view source on GitHub ↗

Ask a single question about the database. This is a convenience function for one-shot questions without maintaining conversation history. Args: question: The question to ask sid: Server ID did: Database ID provider: Optional LLM provider override

(
    question: str,
    sid: int,
    did: int,
    provider: Optional[str] = None,
    model: Optional[str] = None
)

Source from the content-addressed store, hash-verified

267
268
269def single_query(
270 question: str,
271 sid: int,
272 did: int,
273 provider: Optional[str] = None,
274 model: Optional[str] = None
275) -> str:
276 """
277 Ask a single question about the database.
278
279 This is a convenience function for one-shot questions without
280 maintaining conversation history.
281
282 Args:
283 question: The question to ask
284 sid: Server ID
285 did: Database ID
286 provider: Optional LLM provider override
287 model: Optional model override
288
289 Returns:
290 The LLM's response text
291
292 Raises:
293 LLMClientError: If the LLM request fails
294 RuntimeError: If LLM is not available
295 """
296 response, _ = chat_with_database(
297 user_message=question,
298 sid=sid,
299 did=did,
300 provider=provider,
301 model=model
302 )
303 return response

Callers

nothing calls this directly

Calls 1

chat_with_databaseFunction · 0.85

Tested by

no test coverage detected