Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Code Generator for AI SDK #652

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ import com.google.common.annotations.Beta;
{{^aiSdkConstructor}}import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
{{/aiSdkConstructor}}
{{#aiSdkConstructor}}import com.sap.ai.sdk.core.AiCoreService;
import com.sap.ai.sdk.core.AiCoreDestination;
{{/aiSdkConstructor}}

/**
Expand Down Expand Up @@ -74,17 +73,17 @@ public class {{classname}} extends AbstractOpenApiService {
*/
public {{classname}}()
{
super(new AiCoreService().client());
super(new AiCoreService().getApiClient());
Copy link
Contributor

@newtork newtork Nov 29, 2024

Choose a reason for hiding this comment

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

(Hindsight)

This would not have been necessary if we had considered parameterized constructors:
#629 (comment)

Should we consider doing this now?

Copy link
Member Author

Choose a reason for hiding this comment

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

true, on the other hand I'd hope we don't have to do frequent changes to this, and if we do, there is the risk the parameters don't exactly fit what we need 😅

No strong opinion though, we also don't have time pressure to implement this, can always be done later on if we like

}

/**
* Instantiates this API class to invoke operations on the {{appName}}
*
* @param aiCoreDestination The configured connectivity instance to AI Core
* @param aiCoreService The configured connectivity instance to AI Core
*/
public {{classname}}( @Nonnull final AiCoreDestination aiCoreDestination )
public {{classname}}( @Nonnull final AiCoreService aiCoreService )
{
super(aiCoreDestination.client());
super(aiCoreService.getApiClient());
}
{{/aiSdkConstructor}}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.google.common.annotations.Beta;

import com.sap.ai.sdk.core.AiCoreService;
import com.sap.ai.sdk.core.AiCoreDestination;

/**
* Soda Store API in version 1.0.0.
Expand All @@ -45,17 +44,17 @@ public class AwesomeSodaApi extends AbstractOpenApiService {
*/
public AwesomeSodaApi()
{
super(new AiCoreService().client());
super(new AiCoreService().getApiClient());
}

/**
* Instantiates this API class to invoke operations on the Soda Store API
*
* @param aiCoreDestination The configured connectivity instance to AI Core
* @param aiCoreService The configured connectivity instance to AI Core
*/
public AwesomeSodaApi( @Nonnull final AiCoreDestination aiCoreDestination )
public AwesomeSodaApi( @Nonnull final AiCoreService aiCoreService )
{
super(aiCoreDestination.client());
super(aiCoreService.getApiClient());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
import com.google.common.annotations.Beta;

import com.sap.ai.sdk.core.AiCoreService;
import com.sap.ai.sdk.core.AiCoreDestination;

/**
* Soda Store API in version 1.0.0.
Expand All @@ -44,17 +43,17 @@ public class AwesomeSodasApi extends AbstractOpenApiService {
*/
public AwesomeSodasApi()
{
super(new AiCoreService().client());
super(new AiCoreService().getApiClient());
}

/**
* Instantiates this API class to invoke operations on the Soda Store API
*
* @param aiCoreDestination The configured connectivity instance to AI Core
* @param aiCoreService The configured connectivity instance to AI Core
*/
public AwesomeSodasApi( @Nonnull final AiCoreDestination aiCoreDestination )
public AwesomeSodasApi( @Nonnull final AiCoreService aiCoreService )
{
super(aiCoreDestination.client());
super(aiCoreService.getApiClient());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import com.google.common.annotations.Beta;

import com.sap.ai.sdk.core.AiCoreService;
import com.sap.ai.sdk.core.AiCoreDestination;

/**
* Soda Store API in version 1.0.0.
Expand All @@ -45,17 +44,17 @@ public class DefaultApi extends AbstractOpenApiService {
*/
public DefaultApi()
{
super(new AiCoreService().client());
super(new AiCoreService().getApiClient());
}

/**
* Instantiates this API class to invoke operations on the Soda Store API
*
* @param aiCoreDestination The configured connectivity instance to AI Core
* @param aiCoreService The configured connectivity instance to AI Core
*/
public DefaultApi( @Nonnull final AiCoreDestination aiCoreDestination )
public DefaultApi( @Nonnull final AiCoreService aiCoreService )
{
super(aiCoreDestination.client());
super(aiCoreService.getApiClient());
}

/**
Expand Down
Loading