Skip to content

Conversation

@markpollack
Copy link
Member

Introduces a new API key management system that allows users to customize how API keys are provided and managed in their Spring AI applications. This change improves security and flexibility by:

  • Adding core ApiKey interface and SimpleApiKey implementation
  • Introducing @OPENAIAPIKEY qualifier for bean disambiguation
  • Supporting custom API key providers for secure key management
  • Adding auto-configuration support for API key injection
  • Adding builder pattern for OpenAiApi configuration
  • Deprecating public constructors in favor of builder API (since 1.0.0.M6)

The new system enables users to implement their own key management strategies while maintaining backward compatibility with property-based configuration.

Introduces a new API key management system that allows users to customize how
API keys are provided and managed in their Spring AI applications. This
change improves security and flexibility by:

- Adding core ApiKey interface and SimpleApiKey implementation
- Introducing @OPENAIAPIKEY qualifier for bean disambiguation
- Supporting custom API key providers for secure key management
- Adding auto-configuration support for API key injection
- Adding builder pattern for OpenAiApi configuration
- Deprecating public constructors in favor of builder API (since 1.0.0.M6)

The new system enables users to implement their own key management
strategies while maintaining backward compatibility with property-based
configuration.
@markpollack markpollack added this to the 1.0.0-M6 milestone Feb 3, 2025
@Retention(RetentionPolicy.RUNTIME)
@Documented
@Qualifier
public @interface OpenAiApiKey {
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

change to OpenAiChatApiKey so it is specific to chat models, there will be OpenAiEmbeddingApiKey different models can have different endpoints.

@markpollack
Copy link
Member Author

Don’t merge, need to remove the annotation to override the ApiKey implementation, the strategy isn’t working out.

@markpollack
Copy link
Member Author

merged in fc2690c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant