MCPcopy Index your code
hub / github.com/chainreactors/EvilProxy / CountPluginExecutor

Method CountPluginExecutor

internal/pluginhost/executor_route.go:104–110  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

102
103// CountPluginExecutor executes a count-tokens request with the named plugin executor without changing the requested model.
104func (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
112func (h *Host) executorAdapterForPlugin(pluginID string) (*executorAdapter, error) {
113 if h == nil {

Callers

nothing calls this directly

Calls 2

CountTokensMethod · 0.65

Tested by

no test coverage detected