MCPcopy Create free account
hub / github.com/GongShichen/LuminaCode / NewAPIClient

Function NewAPIClient

api/client.go:898–913  ·  view source on GitHub ↗
(
	apiKey string,
	baseURL string,
	model string,
	maxTokens int,
	thinkingBudgetTokens *int,
	retryConfig *RetryConfig,
	apiType ...string,
)

Source from the content-addressed store, hash-verified

896 }}
897 }
898 }
899 }
900
901 usage, _ := lastData["usage"].(map[string]any)
902 if len(usage) > 0 {
903 out <- EventResult{Event: map[string]any{
904 "type": "usage",
905 "input_tokens": getInt(usage, "prompt_tokens"),
906 "output_tokens": getInt(usage, "completion_tokens"),
907 }}
908 }
909
910 stopReasonMap := map[string]string{
911 "stop": "end_turn",
912 "tool_calls": "tool_use",
913 "length": "max_tokens",
914 "content_filter": "refusal",
915 }
916

Calls 1

CreateLLMClientFunction · 0.85