okami.mom/albedo
git clone https://git.nkp.pet/okami.mom/albedo
61c43ca
main
1package tui 2 3import ( 4"albedo/cli/internal/testwire" 5"encoding/json" 6"net/http" 7) 8 9const generationA = testwire .GenerationA 10 11var protocolSession = testwire .Session 12 13func writeSessionChange (w http.ResponseWriter ,id ,model ,provider string ) { 14session := protocolSession (id ,generationA ,0 ) 15session ["model" ]= model 16session ["provider_profile" ]= provider 17config := session ["configuration_resource" ].(map [string ]any ) 18v := config ["value" ].(map [string ]any ) 19v ["model" ]= model 20v ["provider_profile" ]= provider 21_ = json .NewEncoder (w ).Encode (map [string ]any {"resource" :config ,"session" :session ,"move" :nil }) 22} 23func protocolEntry (id ,kind ,text string ,position int64 )map [string ]any { 24return map [string ]any {"id" :id ,"position" :position ,"kind" :kind ,"created_at" :nil ,"input_id" :nil ,"turn_id" :nil ,"content_complete" :true ,"content" : []any {map [string ]any {"kind" :"text" ,"text" :text }},"tool" :nil ,"checkpoint_id" :nil } 25}