Skip to content

Commit ad05c65

Browse files
slowtickRajavelu Govindarajandkundel-openai
authored
fix: if prompt is not specified return undefined - fixes #159 (#160)
Co-authored-by: Rajavelu Govindarajan <[email protected]> Co-authored-by: Dominik Kundel <[email protected]>
1 parent 046f8cc commit ad05c65

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

.changeset/hungry-ladybugs-lick.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@openai/agents-openai": patch
3+
---
4+
5+
fix: if prompt is not specified return undefined - fixes #159

packages/agents-openai/src/openaiResponsesModel.ts

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -365,13 +365,15 @@ function isMessageItem(item: protocol.ModelItem): item is protocol.MessageItem {
365365
return false;
366366
}
367367

368-
function getPrompt(prompt: ModelRequest['prompt']): {
369-
id: string;
370-
version?: string;
371-
variables?: Record<string, any>;
372-
} | null {
368+
function getPrompt(prompt: ModelRequest['prompt']):
369+
| {
370+
id: string;
371+
version?: string;
372+
variables?: Record<string, any>;
373+
}
374+
| undefined {
373375
if (!prompt) {
374-
return null;
376+
return undefined;
375377
}
376378

377379
const transformedVariables: Record<string, any> = {};

0 commit comments

Comments
 (0)