MCPcopy
hub / github.com/mudler/LocalAI / SwitchModel

Method SwitchModel

core/cli/chat/session.go:60–67  ·  view source on GitHub ↗
(model string)

Source from the content-addressed store, hash-verified

58}
59
60func (s *chatSession) SwitchModel(model string) error {
61 if !modelExists(s.models, model) {
62 return fmt.Errorf("model %q is not available. Use /models to see installed models", model)
63 }
64 s.model = model
65 s.Clear()
66 return nil
67}
68
69func (s *chatSession) Send(ctx context.Context, prompt string, out io.Writer) error {
70 s.messages = append(s.messages, chatMessage{

Callers 2

session_test.goFile · 0.80
runTerminalChatFunction · 0.80

Calls 2

ClearMethod · 0.95
modelExistsFunction · 0.85

Tested by

no test coverage detected