MCPcopy Create free account
hub / github.com/cloudwego/eino-examples / createSession

Function createSession

quickstart/chatwitheino/server/server_test.go:133–140  ·  view source on GitHub ↗

createSession creates a session via the Store directly.

(t *testing.T, srv *Server[*schema.Message])

Source from the content-addressed store, hash-verified

131
132// createSession creates a session via the Store directly.
133func createSession(t *testing.T, srv *Server[*schema.Message]) string {
134 t.Helper()
135 sess, err := srv.cfg.Store.GetOrCreate("test-" + time.Now().Format("150405.000"))
136 if err != nil {
137 t.Fatalf("create session: %v", err)
138 }
139 return sess.ID
140}
141
142// ---------------------------------------------------------------------------
143// Tests

Callers 5

TestNewLoopCreationFunction · 0.70
TestChatNormalFlowFunction · 0.70
TestAbortStopsLoopFunction · 0.70
TestPreemptQueuesNewItemFunction · 0.70

Calls 1

GetOrCreateMethod · 0.80

Tested by

no test coverage detected