@@ -55,12 +55,12 @@ func TestOctoMLClient_ChatRequest(t *testing.T) {
55
55
client , err := NewClient (providerCfg , clientCfg , telemetry .NewTelemetryMock ())
56
56
require .NoError (t , err )
57
57
58
- request := schemas.ChatRequest { Message : schemas.ChatMessage {
58
+ chatParams := schemas.ChatParams { Messages : [] schemas.ChatMessage { {
59
59
Role : "human" ,
60
60
Content : "What's the biggest animal?" ,
61
- }}
61
+ }}}
62
62
63
- response , err := client .Chat (ctx , & request )
63
+ response , err := client .Chat (ctx , & chatParams )
64
64
require .NoError (t , err )
65
65
66
66
require .Equal (t , providerCfg .ModelName , response .ModelName )
@@ -88,15 +88,13 @@ func TestOctoMLClient_Chat_Error(t *testing.T) {
88
88
require .NoError (t , err )
89
89
90
90
// Create a chat request
91
- request := schemas.ChatRequest {
92
- Message : schemas.ChatMessage {
93
- Role : "human" ,
94
- Content : "What's the biggest animal?" ,
95
- },
96
- }
91
+ chatParams := schemas.ChatParams {Messages : []schemas.ChatMessage {{
92
+ Role : "human" ,
93
+ Content : "What's the biggest animal?" ,
94
+ }}}
97
95
98
96
// Call the Chat function
99
- _ , err = client .Chat (ctx , & request )
97
+ _ , err = client .Chat (ctx , & chatParams )
100
98
101
99
// Check the error
102
100
require .Error (t , err )
@@ -122,9 +120,12 @@ func TestDoChatRequest_ErrorResponse(t *testing.T) {
122
120
require .NoError (t , err )
123
121
124
122
// Create a chat request payload
125
- payload := schemas .NewChatFromStr ("What's the dealio?" )
123
+ chatParams := schemas.ChatParams {Messages : []schemas.ChatMessage {{
124
+ Role : "user" ,
125
+ Content : "What's the dealeo?" ,
126
+ }}}
126
127
127
- _ , err = client .Chat (ctx , payload )
128
+ _ , err = client .Chat (ctx , & chatParams )
128
129
129
130
require .Error (t , err )
130
131
require .Contains (t , err .Error (), "provider is not available" )
0 commit comments