File tree Expand file tree Collapse file tree 3 files changed +7
-26
lines changed
packages/langchain/src/openai Expand file tree Collapse file tree 3 files changed +7
-26
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @sap-ai-sdk/langchain ' : minor
3+ ---
4+
5+ [ Compatibility Note] Remove structured ouput handing for deprecated gpt-4 & gpt-3 models
Original file line number Diff line number Diff line change @@ -259,20 +259,6 @@ describe('Chat client', () => {
259259 ) ;
260260 } ) ;
261261
262- it ( 'should use `functionCalling` for older deprecated models' , async ( ) => {
263- const oldClient = new AzureOpenAiChatClient ( {
264- modelName : 'gpt-35-turbo'
265- } ) ;
266- const spy = jest . spyOn ( oldClient , 'withConfig' ) ;
267-
268- oldClient . withStructuredOutput ( joke ) ;
269- expect ( spy ) . toHaveBeenCalledWith (
270- expect . objectContaining ( {
271- tools : expect . any ( Array )
272- } )
273- ) ;
274- } ) ;
275-
276262 it ( 'should use `functionCalling` with openai function json schema' , async ( ) => {
277263 const openAiFunctionJsonSchema : AzureOpenAiFunctionObject = {
278264 name : 'joke' ,
Original file line number Diff line number Diff line change @@ -175,18 +175,8 @@ export class AzureOpenAiChatClient extends BaseChatModel<AzureOpenAiChatCallOpti
175175 ) ;
176176 }
177177
178- // TODO: Remove this once the deprecated models are removed
179- if (
180- ! this . modelName . startsWith ( 'gpt-3' ) &&
181- ! this . modelName . startsWith ( 'gpt-4-' ) &&
182- this . modelName !== 'gpt-4'
183- ) {
184- if ( method === undefined ) {
185- method = 'jsonSchema' ;
186- }
187- } else if ( method === 'jsonSchema' ) {
188- // Falling back to tool calling.`
189- method = '' ;
178+ if ( method === undefined ) {
179+ method = 'jsonSchema' ;
190180 }
191181
192182 if ( method === 'jsonMode' ) {
You can’t perform that action at this time.
0 commit comments