8 sessionIDContextKey string
9 messageIDContextKey string
10 supportsImagesKey string
15 // SessionIDContextKey is the key for the session ID in the context.
16 SessionIDContextKey sessionIDContextKey = "session_id"
17 // MessageIDContextKey is the key for the message ID in the context.
18 MessageIDContextKey messageIDContextKey = "message_id"
19 // SupportsImagesContextKey is the key for the model's image support capability.
20 SupportsImagesContextKey supportsImagesKey = "supports_images"
21 // ModelNameContextKey is the key for the model name in the context.
22 ModelNameContextKey modelNameKey = "model_name"
25// GetSessionFromContext retrieves the session ID from the context.
26func GetSessionFromContext(ctx context.Context) string {
27 sessionID := ctx.Value(SessionIDContextKey)
31 s, ok := sessionID.(string)
38// GetMessageFromContext retrieves the message ID from the context.
39func GetMessageFromContext(ctx context.Context) string {
40 messageID := ctx.Value(MessageIDContextKey)
44 s, ok := messageID.(string)
51// GetSupportsImagesFromContext retrieves whether the model supports images from the context.
52func GetSupportsImagesFromContext(ctx context.Context) bool {
53 supportsImages := ctx.Value(SupportsImagesContextKey)
54 if supportsImages == nil {
57 if supports, ok := supportsImages.(bool); ok {
63// GetModelNameFromContext retrieves the model name from the context.
64func GetModelNameFromContext(ctx context.Context) string {
65 modelName := ctx.Value(ModelNameContextKey)
69 s, ok := modelName.(string)
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list