Skip to content

【OpenAI】support imagesPath configuration for OpenAIImageModel #3113

@lambochen

Description

@lambochen

Please do a quick search on GitHub issues first, the feature you are about to request might have already been requested.

Expected Behavior

support imagesPath configuration for OpenAIImageModel , like spring.ai.openai.embedding.embeddings-path.

Current Behavior

Does not support customization, the code is fixed as:v1/images/generations

@see org.springframework.ai.openai.api.OpenAiImageApi#createImage

public ResponseEntity<OpenAiImageResponse> createImage(OpenAiImageRequest openAiImageRequest) {
	Assert.notNull(openAiImageRequest, "Image request cannot be null.");
	Assert.hasLength(openAiImageRequest.prompt(), "Prompt cannot be empty.");
	return this.restClient.post()
		.uri("v1/images/generations")
		.body(openAiImageRequest)
		.retrieve()
		.toEntity(OpenAiImageResponse.class);
}

Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions