MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / _validate_retrievals

Function _validate_retrievals

backend/app/operators/assistant/assistant.py:46–68  ·  view source on GitHub ↗

Validate retrievals :param retrievals: a list of assistant retrievals :param retrieval_configs: assistant retrieval configs :param model: the assistant model :return:

(
    retrievals: List[RetrievalRef],
    retrieval_configs: RetrievalConfig,
    model: Model,
)

Source from the content-addressed store, hash-verified

44
45
46async def _validate_retrievals(
47 retrievals: List[RetrievalRef],
48 retrieval_configs: RetrievalConfig,
49 model: Model,
50):
51 """
52 Validate retrievals
53 :param retrievals: a list of assistant retrievals
54 :param retrieval_configs: assistant retrieval configs
55 :param model: the assistant model
56 :return:
57 """
58 from app.services.retrieval import verify_retrievals
59
60 if not retrievals:
61 return
62
63 if retrieval_configs.method == RetrievalMethod.FUNCTION_CALL and not model.allow_function_call():
64 raise_request_validation_error(
65 f"The assistant's language model {model.model_id} does not support function call to use retrieval.",
66 )
67
68 await verify_retrievals(retrievals)
69
70
71class AssistantModelOperator(PostgresModelOperator):

Callers 2

createMethod · 0.85
updateMethod · 0.85

Calls 3

verify_retrievalsFunction · 0.90
allow_function_callMethod · 0.45

Tested by

no test coverage detected