Method RefreshAsync
- Namespace
- IntentSharp.Specialist
- Assembly
- IntentSharp.Specialist.dll
RefreshAsync(string, CancellationToken)
Gathers the intent's context again now and, when the request it builds differs from the one the specialist in use answers, requests and waits as EnsureAsync(string, CancellationToken) does. Runs and ensures do not gather context while a specialist is in use for the same definition, so call this when the context alone has changed, for example after the documents a context source reads were updated. A change to the definition is picked up by the next call without it. Returns where the intent stands.
public Task<SpecialistStatus> RefreshAsync(string name, CancellationToken cancellationToken = default)
Parameters
namestringThe intent's name in Catalog.
cancellationTokenCancellationTokenStops this caller's wait, as for EnsureAsync(string, CancellationToken).
Returns
- Task<SpecialistStatus>
Exceptions
- IntentNotFoundException
The catalog has no intent with that name.
- SpecialistWaitTimeoutException
Every wait ended without an offer.
- SpecialistNotFitException
The offer did not fit and nothing requested another.
- SpecialistRequestLimitException
A request was needed but the hourly limit was reached.
- SpecialistOfferException
The service returned an offer the runtime cannot use.
- SpecialistGuardrailException
A request was needed and the guardrail check at the specialist checkpoint refused it.