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

Function seedChat

coderd/x/chatd/chatdebug/service_test.go:1084–1105  ·  view source on GitHub ↗
(
	t *testing.T,
	db database.Store,
)

Source from the content-addressed store, hash-verified

1082}
1083
1084func seedChat(
1085 t *testing.T,
1086 db database.Store,
1087) (database.Organization, database.User, database.Chat, database.ChatModelConfig) {
1088 t.Helper()
1089
1090 org := dbgen.Organization(t, db, database.Organization{})
1091 owner := dbgen.User(t, db, database.User{})
1092 providerName := "openai"
1093 dbgen.ChatProvider(t, db, database.ChatProvider{
1094 Provider: providerName,
1095 DisplayName: "OpenAI",
1096 })
1097
1098 model := dbgen.ChatModelConfig(t, db, database.ChatModelConfig{
1099 Model: "model-" + uuid.NewString(),
1100 IsDefault: true,
1101 })
1102
1103 chat := insertChat(t, db, org.ID, owner.ID, model.ID)
1104 return org, owner, chat, model
1105}
1106
1107func insertChat(
1108 t *testing.T,

Calls 6

OrganizationFunction · 0.92
UserFunction · 0.92
ChatProviderFunction · 0.92
ChatModelConfigFunction · 0.92
insertChatFunction · 0.85
HelperMethod · 0.65

Tested by

no test coverage detected