X-Git-Url: https://git.giacomolli.uk/onechat/blobdiff_plain/c781f79f3c8cb9a7577ee1574d196988da2719b3..d8f3785bb69288663f4cc46bf4d609c6770452d5:/turn_test.go?ds=sidebyside diff --git a/turn_test.go b/turn_test.go index 5341de5..27151a9 100644 --- a/turn_test.go +++ b/turn_test.go @@ -370,6 +370,13 @@ func (r *TurnEventRecorder) Last(kind string) string { return r.LastEvent(kind).Text } +func (r *TurnEventRecorder) Add(event Event) { + r.mutex.Lock() + defer r.mutex.Unlock() + + r.events = append(r.events, event) +} + // LastEvent returns the last event of kind. func (r *TurnEventRecorder) LastEvent(kind string) Event { r.mutex.Lock() @@ -384,11 +391,13 @@ func (r *TurnEventRecorder) LastEvent(kind string) Event { return Event{} } -func (r *TurnEventRecorder) Add(event Event) { - r.mutex.Lock() - defer r.mutex.Unlock() - - r.events = append(r.events, event) +func modelReasoningItem(id, encrypted string) map[string]any { + return map[string]any{ + "type": "reasoning", + "id": id, + "encrypted_content": encrypted, + "summary": []any{}, + } } // turnInputTexts returns the text of each user message of the input of call. @@ -424,12 +433,3 @@ func turnInputTexts(t *testing.T, call ModelFakeCall) []string { return texts } - -func modelReasoningItem(id, encrypted string) map[string]any { - return map[string]any{ - "type": "reasoning", - "id": id, - "encrypted_content": encrypted, - "summary": []any{}, - } -}