Reading the stored strategies¶
stored = sales.autograph.strategies()
One call returns the strategy the strategizer chose for each cluster, as stored on the platform. It reads; it starts no run and waits for nothing. Call it after Choosing a strategy per cluster has finished, or any time later to see what the import will use.
Before sending anything, strategies reloads the project and refuses if it
has no AutoGraph service.
Parameters¶
None.
Return value¶
A GetRagStrategizerStrategyResponse with three
attributes:
strategiesOne entry per cluster. Each has
cluster_id,strategy_type("FullGraphRAG"or"VectorRAG"),rag_partition_id, theentity_typesthe strategizer expects to find,document_countand aparametersmapping of further settings.total_strategiesHow many entries there are.
strategy_type_countsHow many clusters got each strategy type, keyed by type name.
Before the strategizer has run for the project, the list is empty and the
counts are zero. The import step refuses to run on such a project with
NoStrategiesError.
Errors¶
AutoGraphNotDeployedErrorThe project has no AutoGraph service. Nothing was sent.
Any other failure surfaces as one of the general SDK exceptions described in Errors.
Example¶
sales = client.project.get(project_name="sales")
stored = sales.autograph.strategies()
for strategy in stored.strategies:
print(f"{strategy.cluster_id}: {strategy.strategy_type}, {strategy.document_count} documents")