Skip to content

Commit

Permalink
changed marketplace-assistant to ai
Browse files Browse the repository at this point in the history
  • Loading branch information
Thenujan-Nagaratnam committed Mar 23, 2024
1 parent 5ad1ec6 commit da1fcc5
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 20 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3655,7 +3655,7 @@ paths:
######################################################
# The "Marketplace Assistant Feature" resource APIs
######################################################
'/marketplace-assistant/api-count':
'/ai/api-count':

#-----------------------------------------------------
# Get No of apis in the VectorDB
Expand Down Expand Up @@ -3685,7 +3685,7 @@ paths:
Internal Server Error.
An error occurred while checking the health status of API Chat service.
'/marketplace-assistant/chat':
'/ai/chat':

#-----------------------------------------------------
# Chat with Marketplace Assistant
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
import org.wso2.carbon.apimgt.rest.api.store.v1.dto.MarketplaceAssistantApiCountResponseDTO;
import org.wso2.carbon.apimgt.rest.api.store.v1.dto.MarketplaceAssistantRequestDTO;
import org.wso2.carbon.apimgt.rest.api.store.v1.dto.MarketplaceAssistantResponseDTO;
import org.wso2.carbon.apimgt.rest.api.store.v1.MarketplaceAssistantApiService;
import org.wso2.carbon.apimgt.rest.api.store.v1.impl.MarketplaceAssistantApiServiceImpl;
import org.wso2.carbon.apimgt.rest.api.store.v1.AiApiService;
import org.wso2.carbon.apimgt.rest.api.store.v1.impl.AiApiServiceImpl;
import org.wso2.carbon.apimgt.api.APIManagementException;

import javax.ws.rs.*;
Expand All @@ -24,18 +24,18 @@
import java.util.Map;
import java.util.List;
import javax.validation.constraints.*;
@Path("/marketplace-assistant")
@Path("/ai")

@Api(description = "the marketplace-assistant API")
@Api(description = "the ai API")




public class MarketplaceAssistantApi {
public class AiApi {

@Context MessageContext securityContext;

MarketplaceAssistantApiService delegate = new MarketplaceAssistantApiServiceImpl();
AiApiService delegate = new AiApiServiceImpl();


@GET
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import javax.ws.rs.core.SecurityContext;


public interface MarketplaceAssistantApiService {
public interface AiApiService {
public Response getMarketplaceAssistantApiCount(MessageContext messageContext) throws APIManagementException;
public Response marketplaceAssistantExecute(MarketplaceAssistantRequestDTO marketplaceAssistantRequestDTO, MessageContext messageContext) throws APIManagementException;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@
import javax.ws.rs.core.SecurityContext;


public class MarketplaceAssistantApiServiceImpl implements MarketplaceAssistantApiService {
public class AiApiServiceImpl implements AiApiService {

private static final Log log = LogFactory.getLog(MarketplaceAssistantApiServiceImpl.class);
private static final Log log = LogFactory.getLog(AiApiServiceImpl.class);

private static MarketplaceAssistantConfigurationDto marketplaceAssistantConfigurationDto;
private static MarketplaceAssistantConfigurationDto marketplaceAssistantConfigurationDto;

@Override
public Response marketplaceAssistantExecute(MarketplaceAssistantRequestDTO marketplaceAssistantRequestDTO,
MessageContext messageContext) throws APIManagementException {
@Override
public Response marketplaceAssistantExecute(MarketplaceAssistantRequestDTO marketplaceAssistantRequestDTO,
MessageContext messageContext) throws APIManagementException {
APIManagerConfiguration configuration = ServiceReferenceHolder.
getInstance().getAPIManagerConfigurationService().getAPIManagerConfiguration();

Expand Down Expand Up @@ -89,8 +89,8 @@ public Response marketplaceAssistantExecute(MarketplaceAssistantRequestDTO marke
return null;
}

@Override
public Response getMarketplaceAssistantApiCount(MessageContext messageContext) throws APIManagementException {
@Override
public Response getMarketplaceAssistantApiCount(MessageContext messageContext) throws APIManagementException {
APIManagerConfiguration configuration = ServiceReferenceHolder.
getInstance().getAPIManagerConfigurationService().getAPIManagerConfiguration();

Expand All @@ -104,7 +104,7 @@ public Response getMarketplaceAssistantApiCount(MessageContext messageContext) t

CloseableHttpResponse response = APIUtil.
getMarketplaceChatApiCount(marketplaceAssistantConfigurationDto.getEndpoint(),
marketplaceAssistantConfigurationDto.getApiCountResource());
marketplaceAssistantConfigurationDto.getApiCountResource());
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode == HttpStatus.SC_OK) {
String responseStr = EntityUtils.toString(response.getEntity());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3655,7 +3655,7 @@ paths:
######################################################
# The "Marketplace Assistant Feature" resource APIs
######################################################
'/marketplace-assistant/api-count':
'/ai/api-count':

#-----------------------------------------------------
# Get No of apis in the VectorDB
Expand Down Expand Up @@ -3685,7 +3685,7 @@ paths:
Internal Server Error.
An error occurred while checking the health status of API Chat service.
'/marketplace-assistant/chat':
'/ai/chat':

#-----------------------------------------------------
# Chat with Marketplace Assistant
Expand Down

0 comments on commit da1fcc5

Please sign in to comment.