@@ -22,15 +22,15 @@ type LangProvider interface {
22
22
23
23
SupportChatStream () bool
24
24
25
- Chat (ctx context.Context , req * schemas.ChatRequest ) (* schemas.ChatResponse , error )
26
- ChatStream (ctx context.Context , req * schemas.ChatStreamRequest ) (clients.ChatStream , error )
25
+ Chat (ctx context.Context , params * schemas.ChatParams ) (* schemas.ChatResponse , error )
26
+ ChatStream (ctx context.Context , params * schemas.ChatParams ) (clients.ChatStream , error )
27
27
}
28
28
29
29
type LangModel interface {
30
30
Model
31
31
Provider () string
32
- Chat (ctx context.Context , req * schemas.ChatRequest ) (* schemas.ChatResponse , error )
33
- ChatStream (ctx context.Context , req * schemas.ChatStreamRequest ) (<- chan * clients.ChatStreamResult , error )
32
+ Chat (ctx context.Context , params * schemas.ChatParams ) (* schemas.ChatResponse , error )
33
+ ChatStream (ctx context.Context , params * schemas.ChatParams ) (<- chan * clients.ChatStreamResult , error )
34
34
}
35
35
36
36
// LanguageModel wraps provider client and expend it with health & latency tracking
@@ -87,10 +87,10 @@ func (m LanguageModel) ChatStreamLatency() *latency.MovingAverage {
87
87
return m .chatStreamLatency
88
88
}
89
89
90
- func (m * LanguageModel ) Chat (ctx context.Context , request * schemas.ChatRequest ) (* schemas.ChatResponse , error ) {
90
+ func (m * LanguageModel ) Chat (ctx context.Context , params * schemas.ChatParams ) (* schemas.ChatResponse , error ) {
91
91
startedAt := time .Now ()
92
92
93
- resp , err := m .client .Chat (ctx , request )
93
+ resp , err := m .client .Chat (ctx , params )
94
94
if err != nil {
95
95
m .healthTracker .TrackErr (err )
96
96
@@ -106,8 +106,8 @@ func (m *LanguageModel) Chat(ctx context.Context, request *schemas.ChatRequest)
106
106
return resp , err
107
107
}
108
108
109
- func (m * LanguageModel ) ChatStream (ctx context.Context , req * schemas.ChatStreamRequest ) (<- chan * clients.ChatStreamResult , error ) {
110
- stream , err := m .client .ChatStream (ctx , req )
109
+ func (m * LanguageModel ) ChatStream (ctx context.Context , params * schemas.ChatParams ) (<- chan * clients.ChatStreamResult , error ) {
110
+ stream , err := m .client .ChatStream (ctx , params )
111
111
112
112
if err != nil {
113
113
m .healthTracker .TrackErr (err )
0 commit comments