MCPcopy
hub / github.com/ConnectAI-E/feishu-openai / SetPicResolution

Method SetPicResolution

code/services/sessionCache.go:192–213  ·  view source on GitHub ↗
(sessionId string,
	resolution Resolution)

Source from the content-addressed store, hash-verified

190}
191
192func (s *SessionService) SetPicResolution(sessionId string,
193 resolution Resolution) {
194 maxCacheTime := time.Hour * 12
195
196 //if not in [Resolution256, Resolution512, Resolution1024] then set
197 //to Resolution256
198 switch resolution {
199 case Resolution256, Resolution512, Resolution1024, Resolution10241792, Resolution17921024:
200 default:
201 resolution = Resolution1024
202 }
203
204 sessionContext, ok := s.cache.Get(sessionId)
205 if !ok {
206 sessionMeta := &SessionMeta{PicSetting: PicSetting{resolution: resolution}}
207 s.cache.Set(sessionId, sessionMeta, maxCacheTime)
208 return
209 }
210 sessionMeta := sessionContext.(*SessionMeta)
211 sessionMeta.PicSetting.resolution = resolution
212 s.cache.Set(sessionId, sessionMeta, maxCacheTime)
213}
214
215func (s *SessionService) GetPicResolution(sessionId string) string {
216 sessionContext, ok := s.cache.Get(sessionId)

Callers

nothing calls this directly

Calls 2

GetMethod · 0.65
SetMethod · 0.65

Tested by

no test coverage detected