MCPcopy Index your code
hub / github.com/coder/coder / resolveSendMessageModelConfigID

Function resolveSendMessageModelConfigID

coderd/x/chatd/chatd.go:1938–1964  ·  view source on GitHub ↗
(
	ctx context.Context,
	store database.Store,
	chat database.Chat,
	requested uuid.UUID,
)

Source from the content-addressed store, hash-verified

1936}
1937
1938func resolveSendMessageModelConfigID(
1939 ctx context.Context,
1940 store database.Store,
1941 chat database.Chat,
1942 requested uuid.UUID,
1943) (uuid.UUID, error) {
1944 if requested == uuid.Nil {
1945 return resolveFallbackModelConfigID(ctx, store, chat.LastModelConfigID)
1946 }
1947
1948 chatdCtx := chatdModelConfigLookupContext(ctx)
1949 if _, err := store.GetChatModelConfigByID(chatdCtx, requested); err != nil {
1950 if errors.Is(err, sql.ErrNoRows) {
1951 return uuid.Nil, xerrors.Errorf(
1952 "%w: %s",
1953 ErrInvalidModelConfigID,
1954 requested,
1955 )
1956 }
1957 return uuid.Nil, xerrors.Errorf(
1958 "get requested model config %s: %w",
1959 requested,
1960 err,
1961 )
1962 }
1963 return requested, nil
1964}
1965
1966func resolveQueuedMessageModelConfigID(
1967 ctx context.Context,

Callers 1

SendMessageMethod · 0.85

Calls 5

IsMethod · 0.45
ErrorfMethod · 0.45

Tested by

no test coverage detected