CountPluginExecutor executes a count-tokens request with the named plugin executor without changing the requested model.
(ctx context.Context, pluginID string, req coreexecutor.Request, opts coreexecutor.Options)
| 102 | |
| 103 | // CountPluginExecutor executes a count-tokens request with the named plugin executor without changing the requested model. |
| 104 | func (h *Host) CountPluginExecutor(ctx context.Context, pluginID string, req coreexecutor.Request, opts coreexecutor.Options) (coreexecutor.Response, error) { |
| 105 | adapter, errAdapter := h.executorAdapterForPlugin(pluginID) |
| 106 | if errAdapter != nil { |
| 107 | return coreexecutor.Response{}, errAdapter |
| 108 | } |
| 109 | return adapter.CountTokens(ctx, (*coreauth.Auth)(nil), req, opts) |
| 110 | } |
| 111 | |
| 112 | func (h *Host) executorAdapterForPlugin(pluginID string) (*executorAdapter, error) { |
| 113 | if h == nil { |
nothing calls this directly
no test coverage detected