Completion#
- class scikitplot.corpus.Completion(text, provider, model, finish_reason=None, input_tokens=None, output_tokens=None, latency_s=0.0, cached=False, usage=<factory>)[source]#
One model response.
- Parameters:
- textstr
The response text.
- providerstr
"openai","anthropic","gemini"or"callable".- modelstr
Model name as requested.
- finish_reasonstr or None, default=None
The provider’s reason for stopping (OpenAI
finish_reason, Anthropicstop_reason, Geminifinish_reasonname).- input_tokens, output_tokensint or None, default=None
The provider’s own counts: OpenAI
prompt_tokensandcompletion_tokens(which include reasoning tokens), Anthropicinput_tokensandoutput_tokens, Geminiprompt_token_countandcandidates_token_count(thinking tokens are inusage).- latency_sfloat, default=0.0
Seconds spent in the provider call;
0.0for a cache hit.- cachedbool, default=False
Whether the response came from the cache.
- usagemapping, default={}
Every integer usage counter the provider reported, by its own name.
- Parameters: