Skip to content

Commit

Permalink
Allow <Image> fallback content to be customized (#547)
Browse files Browse the repository at this point in the history
  • Loading branch information
petersalas authored May 11, 2024
1 parent 2df9c5e commit 1df0cfc
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/ai-jsx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"repository": "fixie-ai/ai-jsx",
"bugs": "https://github.com/fixie-ai/ai-jsx/issues",
"homepage": "https://ai-jsx.com",
"version": "0.33.0",
"version": "0.33.1",
"volta": {
"extends": "../../package.json"
},
Expand Down
4 changes: 3 additions & 1 deletion packages/ai-jsx/src/core/image-gen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,8 @@ export function Image(props: {
detail?: string;
/** The number of input tokens required. */
inputTokens?: number;
/** Fallback content to be rendered when stringifying. */
children?: Node;
}) {
return props.url;
return 'children' in props ? props.children : props.url;
}
6 changes: 5 additions & 1 deletion packages/docs/docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,10 @@
# Changelog

## 0.33.0
## 0.33.1

- Allow `<Image>` fallback content to be customized.

## [0.33.0](https://github.com/fixie-ai/ai-jsx/tree/2df9c5e98b5507dd4b59bd9cf04cc6a92148db90)

- Add support for passing `<Image>` to OpenAI models.

Expand Down

0 comments on commit 1df0cfc

Please sign in to comment.