@@ -29,16 +29,16 @@ func (cr *BifrostChatRequest) GetExtraParams() map[string]interface{} {
2929
3030// BifrostChatResponse represents the complete result from a chat completion request.
3131type BifrostChatResponse struct {
32- ID string `json:"id"`
33- Choices []BifrostResponseChoice `json:"choices"`
34- Created int `json:"created"` // The Unix timestamp (in seconds).
35- Model string `json:"model"`
36- Object string `json:"object"` // "chat.completion" or "chat.completion.chunk"
37- ServiceTier * string `json:"service_tier,omitempty"`
38- SystemFingerprint string `json:"system_fingerprint"`
39- Usage * BifrostLLMUsage `json:"usage"`
40- ExtraFields BifrostResponseExtraFields `json:"extra_fields"`
41- ExtraParams map [string ]interface {} `json:"-"`
32+ ID string `json:"id"`
33+ Choices []BifrostResponseChoice `json:"choices"`
34+ Created int `json:"created"` // The Unix timestamp (in seconds).
35+ Model string `json:"model"`
36+ Object string `json:"object"` // "chat.completion" or "chat.completion.chunk"
37+ ServiceTier * string `json:"service_tier,omitempty"`
38+ SystemFingerprint string `json:"system_fingerprint"`
39+ Usage * BifrostLLMUsage `json:"usage"`
40+ ExtraFields BifrostResponseExtraFields `json:"extra_fields"`
41+ ExtraParams map [string ]interface {} `json:"-"`
4242
4343 // Perplexity-specific fields
4444 SearchResults []SearchResult `json:"search_results,omitempty"`
@@ -56,14 +56,15 @@ func (cr *BifrostChatResponse) ToTextCompletionResponse() *BifrostTextCompletion
5656 return & BifrostTextCompletionResponse {
5757 ID : cr .ID ,
5858 Model : cr .Model ,
59+ Created : int64 (cr .Created ),
5960 Object : "text_completion" ,
6061 SystemFingerprint : cr .SystemFingerprint ,
6162 Usage : cr .Usage ,
6263 ExtraFields : BifrostResponseExtraFields {
6364 RequestType : TextCompletionRequest ,
6465 ChunkIndex : cr .ExtraFields .ChunkIndex ,
6566 Provider : cr .ExtraFields .Provider ,
66- ModelRequested : cr .ExtraFields .ModelRequested ,
67+ ModelRequested : cr .ExtraFields .ModelRequested ,
6768 Latency : cr .ExtraFields .Latency ,
6869 RawResponse : cr .ExtraFields .RawResponse ,
6970 CacheDebug : cr .ExtraFields .CacheDebug ,
@@ -79,6 +80,7 @@ func (cr *BifrostChatResponse) ToTextCompletionResponse() *BifrostTextCompletion
7980 return & BifrostTextCompletionResponse {
8081 ID : cr .ID ,
8182 Model : cr .Model ,
83+ Created : int64 (cr .Created ),
8284 Object : "text_completion" ,
8385 SystemFingerprint : cr .SystemFingerprint ,
8486 Choices : []BifrostResponseChoice {
@@ -96,7 +98,7 @@ func (cr *BifrostChatResponse) ToTextCompletionResponse() *BifrostTextCompletion
9698 RequestType : TextCompletionRequest ,
9799 ChunkIndex : cr .ExtraFields .ChunkIndex ,
98100 Provider : cr .ExtraFields .Provider ,
99- ModelRequested : cr .ExtraFields .ModelRequested ,
101+ ModelRequested : cr .ExtraFields .ModelRequested ,
100102 Latency : cr .ExtraFields .Latency ,
101103 RawResponse : cr .ExtraFields .RawResponse ,
102104 CacheDebug : cr .ExtraFields .CacheDebug ,
@@ -115,6 +117,7 @@ func (cr *BifrostChatResponse) ToTextCompletionResponse() *BifrostTextCompletion
115117 return & BifrostTextCompletionResponse {
116118 ID : cr .ID ,
117119 Model : cr .Model ,
120+ Created : int64 (cr .Created ),
118121 Object : "text_completion" ,
119122 SystemFingerprint : cr .SystemFingerprint ,
120123 Choices : []BifrostResponseChoice {
@@ -132,7 +135,7 @@ func (cr *BifrostChatResponse) ToTextCompletionResponse() *BifrostTextCompletion
132135 RequestType : TextCompletionRequest ,
133136 ChunkIndex : cr .ExtraFields .ChunkIndex ,
134137 Provider : cr .ExtraFields .Provider ,
135- ModelRequested : cr .ExtraFields .ModelRequested ,
138+ ModelRequested : cr .ExtraFields .ModelRequested ,
136139 Latency : cr .ExtraFields .Latency ,
137140 RawResponse : cr .ExtraFields .RawResponse ,
138141 CacheDebug : cr .ExtraFields .CacheDebug ,
@@ -145,6 +148,7 @@ func (cr *BifrostChatResponse) ToTextCompletionResponse() *BifrostTextCompletion
145148 return & BifrostTextCompletionResponse {
146149 ID : cr .ID ,
147150 Model : cr .Model ,
151+ Created : int64 (cr .Created ),
148152 Object : "text_completion" ,
149153 SystemFingerprint : cr .SystemFingerprint ,
150154 Usage : cr .Usage ,
0 commit comments