MCPcopy Create free account
hub / github.com/alibaba/open-code-review / TestEncodingForModel

Function TestEncodingForModel

internal/llm/client_test.go:1988–2009  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

1986}
1987
1988func TestEncodingForModel(t *testing.T) {
1989 tests := []struct {
1990 model string
1991 want string
1992 }{
1993 {"gpt-4", "cl100k_base"},
1994 {"claude-3-opus", "cl100k_base"},
1995 {"", "cl100k_base"},
1996 {"o1-preview", "o200k_base"},
1997 {"o3-mini", "o200k_base"},
1998 {"o4-mini", "o200k_base"},
1999 {"GPT-O1", "o200k_base"},
2000 }
2001 for _, tt := range tests {
2002 t.Run(tt.model, func(t *testing.T) {
2003 got := encodingForModel(tt.model)
2004 if got != tt.want {
2005 t.Errorf("encodingForModel(%q) = %q, want %q", tt.model, got, tt.want)
2006 }
2007 })
2008 }
2009}
2010
2011func TestNewLLMClient_Dispatch(t *testing.T) {
2012 tests := []struct {

Callers

nothing calls this directly

Calls 2

encodingForModelFunction · 0.85
RunMethod · 0.65

Tested by

no test coverage detected