index
int64
repo_id
string
file_path
string
content
string
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/database/UpdateTableDescriptionRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.database; import com.google.gson.annotations.SerializedName; public class UpdateTableDescriptionRequest { @SerializedName("table_name") private TableName tableName; private String description; public TableName getTableName() { return tableName; } public void setTableName(TableName tableName) { this.tableName = tableName; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/healthcheck/HealthCheck.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.healthcheck; import java.io.IOException; import ai.waii.WaiiHttpClient; public class HealthCheck { private final WaiiHttpClient httpClient; private static final String HEALTH_CHECK_ENDPOINT = "health-check"; public HealthCheck(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public HealthCheckResponse healthCheck() throws IOException { String jsonParams = "{}"; return this.httpClient.commonFetch(HEALTH_CHECK_ENDPOINT, jsonParams, HealthCheckResponse.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/healthcheck/HealthCheckResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.healthcheck; import com.google.gson.annotations.SerializedName; public class HealthCheckResponse { @SerializedName("llm_health_reports") private LLMEndpointHealthReport[] llmHealthReports; public LLMEndpointHealthReport[] getLlmHealthReports() { return llmHealthReports; } public void setLlmHealthReports(LLMEndpointHealthReport[] llmHealthReports) { this.llmHealthReports = llmHealthReports; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/healthcheck/LLMEndpointHealthReport.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.healthcheck; public class LLMEndpointHealthReport { private String engine; private LLMEndpointStatus status; private String message; public String getEngine() { return engine; } public void setEngine(String engine) { this.engine = engine; } public LLMEndpointStatus getStatus() { return status; } public void setStatus(LLMEndpointStatus status) { this.status = status; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/healthcheck/LLMEndpointStatus.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.healthcheck; public enum LLMEndpointStatus { HEALTHY("healthy"), UNHEALTHY("unhealthy"), UNUSABLE("unusable"); private final String status; LLMEndpointStatus(String status) { this.status = status; } public String getStatus() { return status; } @Override public String toString() { return status; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/GeneratedChartHistoryEntry.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import ai.waii.clients.chart.ChartGenerationRequest; import ai.waii.clients.chart.ChartGenerationResponse; public class GeneratedChartHistoryEntry extends HistoryEntry { private ChartGenerationRequest request; private ChartGenerationResponse response; public ChartGenerationRequest getRequest() { return request; } public void setRequest(ChartGenerationRequest request) { this.request = request; } public ChartGenerationResponse getResponse() { return response; } public void setResponse(ChartGenerationResponse response) { this.response = response; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/GeneratedChatHistoryEntry.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import ai.waii.clients.chart.ChartGenerationRequest; import ai.waii.clients.chart.ChartGenerationResponse; public class GeneratedChatHistoryEntry extends HistoryEntry { private ChartGenerationRequest request; private ChartGenerationResponse response; public ChartGenerationRequest getRequest() { return request; } public void setRequest(ChartGenerationRequest request) { this.request = request; } public ChartGenerationResponse getResponse() { return response; } public void setResponse(ChartGenerationResponse response) { this.response = response; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/GeneratedHistoryEntryType.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import com.google.gson.annotations.SerializedName; public enum GeneratedHistoryEntryType { @SerializedName("query") QUERY("query"), @SerializedName("chart") CHART("chart"), @SerializedName("chat") CHAT("chat"); private final String value; GeneratedHistoryEntryType(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return value; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/GeneratedQueryHistoryEntry.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import ai.waii.clients.query.GeneratedQuery; import ai.waii.clients.query.QueryGenerationRequest; public class GeneratedQueryHistoryEntry extends HistoryEntry { private GeneratedQuery query; private QueryGenerationRequest request; public GeneratedQuery getQuery() { return query; } public void setQuery(GeneratedQuery query) { this.query = query; } public QueryGenerationRequest getRequest() { return request; } public void setRequest(QueryGenerationRequest request) { this.request = request; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/GetGeneratedQueryHistoryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import com.google.gson.annotations.SerializedName; public class GetGeneratedQueryHistoryRequest { @SerializedName("included_type") private GeneratedHistoryEntryType[] includedTypes = {GeneratedHistoryEntryType.QUERY}; private Integer limit; private Integer offset; @SerializedName("timestamp_sort_order") SortOrder timestampSortOrder; @SerializedName("uuid_filter") private String uuidFilter; public Integer getLimit() { return limit; } public GetGeneratedQueryHistoryRequest setLimit(Integer limit) { this.limit = limit; return this; } public Integer getOffset() { return offset; } public GetGeneratedQueryHistoryRequest setOffset(Integer offset) { this.offset = offset; return this; } public GeneratedHistoryEntryType[] getIncludedTypes() { return includedTypes; } public void setIncludedTypes(GeneratedHistoryEntryType[] includedTypes) { this.includedTypes = includedTypes; } public SortOrder getTimestampSortOrder() { return timestampSortOrder; } public GetGeneratedQueryHistoryRequest setTimestampSortOrder(SortOrder timestampSortOrder) { this.timestampSortOrder = timestampSortOrder; return this; } public String getUuidFilter() { return uuidFilter; } public GetGeneratedQueryHistoryRequest setUuidFilter(String uuidFilter) { this.uuidFilter = uuidFilter; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/GetGeneratedQueryHistoryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; public class GetGeneratedQueryHistoryResponse { private HistoryEntry[] history; public HistoryEntry[] getHistory() { return history; } public void setHistory(HistoryEntry[] history) { this.history = history; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/History.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import java.io.IOException; import java.lang.reflect.Type; import com.google.gson.Gson; import com.google.gson.JsonDeserializationContext; import com.google.gson.JsonDeserializer; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import ai.waii.WaiiHttpClient; public class History { private final WaiiHttpClient httpClient; private static final String GET_ENDPOINT = "get-generated-query-history"; public History(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public GetGeneratedQueryHistoryResponse list(GetGeneratedQueryHistoryRequest params) throws IOException { Gson gson = new Gson().newBuilder() .registerTypeAdapter(HistoryEntry.class, new HistoryEntryDeserializer()) .create(); String jsonParams = gson.toJson(params); return gson.fromJson(this.httpClient.commonFetchRaw(GET_ENDPOINT, jsonParams), GetGeneratedQueryHistoryResponse.class); } public static class HistoryEntryDeserializer implements JsonDeserializer<HistoryEntry> { @Override public HistoryEntry deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObject = json.getAsJsonObject(); JsonElement typeElement = jsonObject.get("history_type"); if (typeElement != null) { String historyType = typeElement.getAsString(); switch (historyType) { case "query": return context.deserialize(json, GeneratedQueryHistoryEntry.class); case "chart": return context.deserialize(json, GeneratedChartHistoryEntry.class); case "chat": return context.deserialize(json, GeneratedChatHistoryEntry.class); default: throw new JsonParseException("Unknown element type: " + historyType); } } throw new JsonParseException("history_type field is missing"); } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/HistoryEntry.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import com.google.gson.annotations.SerializedName; public class HistoryEntry { @SerializedName("history_type") protected GeneratedHistoryEntryType historyType; public GeneratedHistoryEntryType getHistoryType() { return historyType; } public void setHistoryType(GeneratedHistoryEntryType historyType) { this.historyType = historyType; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/history/SortOrder.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.history; import com.google.gson.annotations.SerializedName; public enum SortOrder { @SerializedName("asc") ASC("asc"), @SerializedName("desc") DESC("desc"); private final String value; SortOrder(String value) { this.value = value; } public String getValue() { return value; } @Override public String toString() { return value; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/model/GetEmbeddingModelsResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.model; import com.google.gson.annotations.SerializedName; public class GetEmbeddingModelsResponse { @SerializedName("embedding_models") private String[] embeddingModels; public String[] getEmbeddingModels() { return embeddingModels; } public void setEmbeddingModels(String[] embeddingModels) { this.embeddingModels = embeddingModels; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/model/GetModelsRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.model; public class GetModelsRequest { }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/model/GetModelsResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.model; public class GetModelsResponse { private Model[] models; public Model[] getModels() { return models; } public void setModels(Model[] models) { this.models = models; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/model/LLM.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.model; import java.io.IOException; import com.google.gson.Gson; import ai.waii.WaiiHttpClient; public class LLM { private final WaiiHttpClient httpClient; private static final String GET_ENDPOINT = "get-models"; private static final String GET_EMBEDDING_ENDPOINT = "get-embedding-models"; public LLM(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public GetModelsResponse getModels(GetModelsRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GET_ENDPOINT, jsonParams, GetModelsResponse.class); } public GetEmbeddingModelsResponse getEmbeddingModels(GetModelsRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GET_EMBEDDING_ENDPOINT, jsonParams, GetEmbeddingModelsResponse.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/model/Model.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.model; public class Model { private String name; private String description; private String vendor; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getDescription() { return description; } public void setDescription(String description) { this.description = description; } public String getVendor() { return vendor; } public void setVendor(String vendor) { this.vendor = vendor; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/AutoCompleteRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.SearchContext; public class AutoCompleteRequest { private String text; @SerializedName("cursor_offset") private Integer cursorOffset; private String dialect; @SerializedName("search_context") private List<SearchContext> searchContext; @SerializedName("max_output_tokens") private Integer maxOutputTokens; public AutoCompleteRequest(String text, Integer cursorOffset, String dialect, List<SearchContext> searchContext, Integer maxOutputTokens) { this.text = text; this.cursorOffset = cursorOffset; this.dialect = dialect; this.searchContext = searchContext; this.maxOutputTokens = maxOutputTokens; } public AutoCompleteRequest() { } public String getText() { return text; } public AutoCompleteRequest setText(String text) { this.text = text; return this; } public Integer getCursorOffset() { return cursorOffset; } public AutoCompleteRequest setCursorOffset(Integer cursorOffset) { this.cursorOffset = cursorOffset; return this; } public String getDialect() { return dialect; } public AutoCompleteRequest setDialect(String dialect) { this.dialect = dialect; return this; } public List<SearchContext> getSearchContext() { return searchContext; } public void setSearchContext(List<SearchContext> searchContext) { this.searchContext = searchContext; } public Integer getMaxOutputTokens() { return maxOutputTokens; } public void setMaxOutputTokens(Integer maxOutputTokens) { this.maxOutputTokens = maxOutputTokens; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/AutoCompleteResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; public class AutoCompleteResponse { private String text; public AutoCompleteResponse(String text) { this.text = text; } // Getters and Setters public String getText() { return text; } public void setText(String text) { this.text = text; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/CancelQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import com.google.gson.annotations.SerializedName; public class CancelQueryRequest { @SerializedName("query_id") private String queryId; public CancelQueryRequest(String queryId) { this.queryId = queryId; } public CancelQueryRequest() { } public String getQueryId() { return queryId; } public CancelQueryRequest setQueryId(String queryId) { this.queryId = queryId; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/CancelQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; public class CancelQueryResponse { private String status; private String message; public CancelQueryResponse(String status, String message) { this.status = status; this.message = message; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/DebugQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; public class DebugQueryRequest { private String query; public DebugQueryRequest(String query) { this.query = query; } public DebugQueryRequest() { } public String getQuery() { return query; } public DebugQueryRequest setQuery(String query) { this.query = query; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/DebugQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; public class DebugQueryResponse { private List<DebugQueryPiece> pieces; public DebugQueryResponse(List<DebugQueryPiece> pieces) { this.pieces = pieces; } public List<DebugQueryPiece> getPieces() { return pieces; } public void setPieces(List<DebugQueryPiece> pieces) { this.pieces = pieces; } public static class DebugQueryPiece { private String label; private String query; @SerializedName("row_count") private Integer rowCount; @SerializedName("error_msg") private String errorMsg; public DebugQueryPiece(String label, String query, Integer rowCount, String errorMsg) { this.label = label; this.query = query; this.rowCount = rowCount; this.errorMsg = errorMsg; } // Getters and Setters public String getLabel() { return label; } public void setLabel(String label) { this.label = label; } public String getQuery() { return query; } public void setQuery(String query) { this.query = query; } public Integer getRowCount() { return rowCount; } public void setRowCount(Integer rowCount) { this.rowCount = rowCount; } public String getErrorMsg() { return errorMsg; } public void setErrorMsg(String errorMsg) { this.errorMsg = errorMsg; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/DescribeQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.SearchContext; public class DescribeQueryRequest { @SerializedName("search_context") private List<SearchContext> searchContext; @SerializedName("current_schema") private String currentSchema; private String query; public DescribeQueryRequest(List<SearchContext> searchContext, String currentSchema, String query) { this.searchContext = searchContext; this.currentSchema = currentSchema; this.query = query; } public DescribeQueryRequest() { } public List<SearchContext> getSearchContext() { return searchContext; } public DescribeQueryRequest setSearchContext(List<SearchContext> searchContext) { this.searchContext = searchContext; return this; } public String getCurrentSchema() { return currentSchema; } public void setCurrentSchema(String currentSchema) { this.currentSchema = currentSchema; } public String getQuery() { return query; } public DescribeQueryRequest setQuery(String query) { this.query = query; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/DescribeQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.TableName; public class DescribeQueryResponse { private String summary; @SerializedName("detailed_steps") private List<String> detailedSteps; private List<TableName> tables; public DescribeQueryResponse(String summary, List<String> detailedSteps, List<TableName> tables) { this.summary = summary; this.detailedSteps = detailedSteps; this.tables = tables; } // Getters and Setters public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public List<String> getDetailedSteps() { return detailedSteps; } public void setDetailedSteps(List<String> detailedSteps) { this.detailedSteps = detailedSteps; } public List<TableName> getTables() { return tables; } public void setTables(List<TableName> tables) { this.tables = tables; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/DiffQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.SearchContext; public class DiffQueryRequest { @SerializedName("search_context") private List<SearchContext> searchContext; @SerializedName("current_schema") private String currentSchema; private String query; @SerializedName("previous_query") private String previousQuery; public DiffQueryRequest(List<SearchContext> searchContext, String currentSchema, String query, String previousQuery) { this.searchContext = searchContext; this.currentSchema = currentSchema; this.query = query; this.previousQuery = previousQuery; } public DiffQueryRequest() { } public List<SearchContext> getSearchContext() { return searchContext; } public DiffQueryRequest setSearchContext(List<SearchContext> searchContext) { this.searchContext = searchContext; return this; } public String getCurrentSchema() { return currentSchema; } public DiffQueryRequest setCurrentSchema(String currentSchema) { this.currentSchema = currentSchema; return this; } public String getQuery() { return query; } public DiffQueryRequest setQuery(String query) { this.query = query; return this; } public String getPreviousQuery() { return previousQuery; } public DiffQueryRequest setPreviousQuery(String previousQuery) { this.previousQuery = previousQuery; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/DiffQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.TableName; public class DiffQueryResponse { private String summary; @SerializedName("detailed_steps") private List<String> detailedSteps; private List<TableName> tables; @SerializedName("what_changed") private String whatChanged; public DiffQueryResponse(String summary, List<String> detailedSteps, List<TableName> tables, String whatChanged) { this.summary = summary; this.detailedSteps = detailedSteps; this.tables = tables; this.whatChanged = whatChanged; } public String getSummary() { return summary; } public void setSummary(String summary) { this.summary = summary; } public List<String> getDetailedSteps() { return detailedSteps; } public void setDetailedSteps(List<String> detailedSteps) { this.detailedSteps = detailedSteps; } public List<TableName> getTables() { return tables; } public void setTables(List<TableName> tables) { this.tables = tables; } public String getWhatChanged() { return whatChanged; } public void setWhatChanged(String whatChanged) { this.whatChanged = whatChanged; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/GenerateQuestionRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import com.google.gson.annotations.SerializedName; public class GenerateQuestionRequest { @SerializedName("schema_name") private String schemaName; @SerializedName("n_questions") private Integer nQuestions; private String complexity; public GenerateQuestionRequest(String schemaName, Integer nQuestions, String complexity) { this.schemaName = schemaName; this.nQuestions = nQuestions; this.complexity = complexity; } public GenerateQuestionRequest() { } public String getSchemaName() { return schemaName; } public GenerateQuestionRequest setSchemaName(String schemaName) { this.schemaName = schemaName; return this; } public Integer getNQuestions() { return nQuestions; } public GenerateQuestionRequest setNQuestions(Integer nQuestions) { this.nQuestions = nQuestions; return this; } public String getComplexity() { return complexity; } public GenerateQuestionRequest setComplexity(String complexity) { this.complexity = complexity; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/GenerateQuestionResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import ai.waii.clients.database.TableName; public class GenerateQuestionResponse { private List<GeneratedQuestion> questions; public GenerateQuestionResponse(List<GeneratedQuestion> questions) { this.questions = questions; } public List<GeneratedQuestion> getQuestions() { return questions; } public void setQuestions(List<GeneratedQuestion> questions) { this.questions = questions; } public static class GeneratedQuestion { private String question; private String complexity; private List<TableName> tables; public GeneratedQuestion(String question, String complexity, List<TableName> tables) { this.question = question; this.complexity = complexity; this.tables = tables; } public String getQuestion() { return question; } public void setQuestion(String question) { this.question = question; } public String getComplexity() { return complexity; } public void setComplexity(String complexity) { this.complexity = complexity; } public List<TableName> getTables() { return tables; } public void setTables(List<TableName> tables) { this.tables = tables; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/GeneratedQuery.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.TableName; import ai.waii.clients.semanticcontext.SemanticStatement; public class GeneratedQuery { @SerializedName("current_step") private String currentStep; private String uuid; private Boolean liked; private List<TableName> tables; @SerializedName("semantic_context") private List<SemanticStatement> semanticContext; private String query; @SerializedName("detailed_steps") private List<String> detailedSteps; @SerializedName("what_changed") private String whatChanged; @SerializedName("compilation_errors") private List<CompilationError> compilationErrors; @SerializedName("is_new") private Boolean isNew; @SerializedName("timestamp_ms") private Long timestampMs; @SerializedName("debug_info") private Map<String, Object> debugInfo; @SerializedName("llm_usage_stats") private LLMUsageStatistics llmUsageStats; @SerializedName("confidence_score") private ConfidenceScore confidenceScore; @SerializedName("elapsed_time_ms") private Integer elapsedTimeMs; private List<String> assumptions; public ConfidenceScore getConfidenceScore() { return confidenceScore; } public void setConfidenceScore(ConfidenceScore confidenceScore) { this.confidenceScore = confidenceScore; } public LLMUsageStatistics getLlmUsageStats() { return llmUsageStats; } public void setLlmUsageStats(LLMUsageStatistics llmUsageStats) { this.llmUsageStats = llmUsageStats; } public GeneratedQuery(String uuid, Boolean liked, List<TableName> tables, List<SemanticStatement> semanticContext, String query, List<String> detailedSteps, String whatChanged, List<CompilationError> compilationErrors, Boolean isNew, Long timestampMs, Map<String, Object> debugInfo, LLMUsageStatistics llmUsageStats, ConfidenceScore confidenceScore) { this.uuid = uuid; this.liked = liked; this.tables = tables; this.semanticContext = semanticContext; this.query = query; this.detailedSteps = detailedSteps; this.whatChanged = whatChanged; this.compilationErrors = compilationErrors; this.isNew = isNew; this.timestampMs = timestampMs; this.debugInfo = debugInfo; this.llmUsageStats = llmUsageStats; this.confidenceScore = confidenceScore; this.elapsedTimeMs = null; this.assumptions = null; } public GeneratedQuery(String uuid, Boolean liked, List<TableName> tables, List<SemanticStatement> semanticContext, String query, List<String> detailedSteps, String whatChanged, List<CompilationError> compilationErrors, Boolean isNew, Long timestampMs, Map<String, Object> debugInfo, LLMUsageStatistics llmUsageStats, ConfidenceScore confidenceScore, Integer elapsedTimeMs, List<String> assumptions) { this.uuid = uuid; this.liked = liked; this.tables = tables; this.semanticContext = semanticContext; this.query = query; this.detailedSteps = detailedSteps; this.whatChanged = whatChanged; this.compilationErrors = compilationErrors; this.isNew = isNew; this.timestampMs = timestampMs; this.debugInfo = debugInfo; this.llmUsageStats = llmUsageStats; this.confidenceScore = confidenceScore; this.elapsedTimeMs = elapsedTimeMs; this.assumptions = assumptions; } public String getUuid() { return uuid; } public void setUuid(String uuid) { this.uuid = uuid; } public Boolean getLiked() { return liked; } public void setLiked(Boolean liked) { this.liked = liked; } public List<TableName> getTables() { return tables; } public void setTables(List<TableName> tables) { this.tables = tables; } public List<SemanticStatement> getSemanticContext() { return semanticContext; } public void setSemanticContext(List<SemanticStatement> semanticContext) { this.semanticContext = semanticContext; } public String getQuery() { return query; } public void setQuery(String query) { this.query = query; } public List<String> getDetailedSteps() { return detailedSteps; } public void setDetailedSteps(List<String> detailedSteps) { this.detailedSteps = detailedSteps; } public String getWhatChanged() { return whatChanged; } public void setWhatChanged(String whatChanged) { this.whatChanged = whatChanged; } public List<CompilationError> getCompilationErrors() { return compilationErrors; } public void setCompilationErrors(List<CompilationError> compilationErrors) { this.compilationErrors = compilationErrors; } public Boolean getIsNew() { return isNew; } public void setIsNew(Boolean isNew) { this.isNew = isNew; } public Long getTimestampMs() { return timestampMs; } public void setTimestampMs(Long timestampMs) { this.timestampMs = timestampMs; } public Map<String, Object> getDebugInfo() { return debugInfo; } public void setDebugInfo(Map<String, Object> debugInfo) { this.debugInfo = debugInfo; } public Integer getElapsedTimeMs() { return elapsedTimeMs; } public void setElapsedTimeMs(Integer elapsedTimeMs) { this.elapsedTimeMs = elapsedTimeMs; } public List<String> getAssumptions() { return assumptions; } public void setAssumptions(List<String> assumptions) { this.assumptions = assumptions; } public String getCurrentStep() { return currentStep; } public void setCurrentStep(String currentStep) { this.currentStep = currentStep; } public static class LLMUsageStatistics { @SerializedName("token_total") private Integer tokenTotal; public Integer getTokenTotal() { return tokenTotal; } public void setTokenTotal(Integer tokenTotal) { this.tokenTotal = tokenTotal; } } public static class ConfidenceScore { @SerializedName("confidence_value") private Double confidence_value; @SerializedName("log_prob_sum") private Double logProbSum; @SerializedName("token_count") private Integer tokenCount; public Double getConfidence_value() { return confidence_value; } public void setConfidence_value(Double confidence_value) { this.confidence_value = confidence_value; } public Double getLogProbSum() { return logProbSum; } public void setLogProbSum(Double logProbSum) { this.logProbSum = logProbSum; } public Integer getTokenCount() { return tokenCount; } public void setTokenCount(Integer tokenCount) { this.tokenCount = tokenCount; } } public static class CompilationError { private String message; private Integer line; public CompilationError(String message, Integer line) { this.message = message; this.line = line; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } public Integer getLine() { return line; } public void setLine(Integer line) { this.line = line; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/GetQueryResultRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import com.google.gson.annotations.SerializedName; public class GetQueryResultRequest { @SerializedName("query_id") private String queryId; public GetQueryResultRequest(String queryId) { this.queryId = queryId; } public GetQueryResultRequest() { } public String getQueryId() { return queryId; } public GetQueryResultRequest setQueryId(String queryId) { this.queryId = queryId; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/GetQueryResultResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.Column; public class GetQueryResultResponse { private List<Map<String, Object>> rows; @SerializedName("more_rows") private Integer moreRows; @SerializedName("column_definition") private List<Column> columnDefinitions; @SerializedName("query_uuid") private String queryUuid; public GetQueryResultResponse(List<Map<String, Object>> rows, Integer moreRows, List<Column> columnDefinitions, String queryUuid) { this.rows = rows; this.moreRows = moreRows; this.columnDefinitions = columnDefinitions; this.queryUuid = queryUuid; } // Getters and Setters public List<Map<String, Object>> getRows() { return rows; } public void setRows(List<Map<String, Object>> rows) { this.rows = rows; } public Integer getMoreRows() { return moreRows; } public void setMoreRows(Integer moreRows) { this.moreRows = moreRows; } public List<Column> getColumnDefinitions() { return columnDefinitions; } public void setColumnDefinitions(List<Column> columnDefinitions) { this.columnDefinitions = columnDefinitions; } public String getQueryUuid() { return queryUuid; } public void setQueryUuid(String queryUuid) { this.queryUuid = queryUuid; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/LLMUsageStatistics.java
package ai.waii.clients.query; public class LLMUsageStatistics { }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/LikeQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import com.google.gson.annotations.SerializedName; public class LikeQueryRequest { @SerializedName("query_uuid") private String queryUuid; private boolean liked; public LikeQueryRequest(String queryUuid, boolean liked) { this.queryUuid = queryUuid; this.liked = liked; } public LikeQueryRequest() { } public String getQueryUuid() { return queryUuid; } public LikeQueryRequest setQueryUuid(String queryUuid) { this.queryUuid = queryUuid; return this; } public boolean isLiked() { return liked; } public LikeQueryRequest setLiked(boolean liked) { this.liked = liked; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/LikeQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; public class LikeQueryResponse { private String status; private String message; public LikeQueryResponse(String status, String message) { this.status = status; this.message = message; } public String getStatus() { return status; } public void setStatus(String status) { this.status = status; } public String getMessage() { return message; } public void setMessage(String message) { this.message = message; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/Query.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.io.IOException; import ai.waii.clients.AsyncObjectResponse; import ai.waii.clients.GetObjectRequest; import com.google.gson.Gson; import ai.waii.WaiiHttpClient; public class Query { private final WaiiHttpClient httpClient; private static final String GENERATE_ENDPOINT = "generate-query"; private static final String RUN_ENDPOINT = "run-query"; private static final String SUBMIT_ENDPOINT = "submit-query"; private static final String FAVORITE_ENDPOINT = "like-query"; private static final String DESCRIBE_ENDPOINT = "describe-query"; private static final String DIFF_ENDPOINT = "diff-query"; private static final String RESULTS_ENDPOINT = "get-query-result"; private static final String CANCEL_ENDPOINT = "cancel-query"; private static final String AUTOCOMPLETE_ENDPOINT = "auto-complete"; private static final String PERF_ENDPOINT = "get-query-performance"; private static final String TRANSCODE_ENDPOINT = "transcode-query"; private static final String GENERATE_QUESTION_ENDPOINT = "generate-questions"; private static final String GET_SIMILAR_QUERY_ENDPOINT = "get-similar-query"; private static final String DEBUG_QUERY_ENDPOINT = "debug-query"; private static final String SUBMIT_GENERATE_ENDPOINT = "submit-generate-query"; private static final String GET_GENERATED_ENDPOINT = "get-generated-query"; public Query(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public GeneratedQuery generate(QueryGenerationRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GENERATE_ENDPOINT, jsonParams, GeneratedQuery.class); } public AsyncObjectResponse submitGenerate(QueryGenerationRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(SUBMIT_GENERATE_ENDPOINT, jsonParams, AsyncObjectResponse.class); } public GeneratedQuery getGenerated(GetObjectRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GET_GENERATED_ENDPOINT, jsonParams, GeneratedQuery.class); } public DebugQueryResponse debug(DebugQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(DEBUG_QUERY_ENDPOINT, jsonParams, DebugQueryResponse.class); } public GeneratedQuery transcode(TranscodeQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(TRANSCODE_ENDPOINT, jsonParams, GeneratedQuery.class); } public GetQueryResultResponse run(RunQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(RUN_ENDPOINT, jsonParams, GetQueryResultResponse.class); } public LikeQueryResponse like(LikeQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(FAVORITE_ENDPOINT, jsonParams, LikeQueryResponse.class); } public RunQueryResponse submit(RunQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(SUBMIT_ENDPOINT, jsonParams, RunQueryResponse.class); } public GetQueryResultResponse getResults(GetQueryResultRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(RESULTS_ENDPOINT, jsonParams, GetQueryResultResponse.class); } public CancelQueryResponse cancel(CancelQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(CANCEL_ENDPOINT, jsonParams, CancelQueryResponse.class); } public DescribeQueryResponse describe(DescribeQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(DESCRIBE_ENDPOINT, jsonParams, DescribeQueryResponse.class); } public AutoCompleteResponse autoComplete(AutoCompleteRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(AUTOCOMPLETE_ENDPOINT, jsonParams, AutoCompleteResponse.class); } public DiffQueryResponse diff(DiffQueryRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(DIFF_ENDPOINT, jsonParams, DiffQueryResponse.class); } public QueryPerformanceResponse analyzePerformance(QueryPerformanceRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(PERF_ENDPOINT, jsonParams, QueryPerformanceResponse.class); } public GenerateQuestionResponse generateQuestion(GenerateQuestionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GENERATE_QUESTION_ENDPOINT, jsonParams, GenerateQuestionResponse.class); } public SimilarQueryResponse getSimilarQuery(GenerateQuestionRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GET_SIMILAR_QUERY_ENDPOINT, jsonParams, SimilarQueryResponse.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/QueryGenerationRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.Map; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.SearchContext; import waii.ai.clients.LLMBasedRequest; public class QueryGenerationRequest extends LLMBasedRequest { @SerializedName("search_context") private SearchContext[] searchContext; @SerializedName("tweak_history") private Tweak[] tweakHistory; private String ask; private String uuid; private String dialect; @SerializedName("parent_uuid") private String parentUuid; private Map<String, Object> flags; @SerializedName("use_example_queries") private Boolean useExampleQueries; public SearchContext[] getSearchContext() { return searchContext; } public QueryGenerationRequest setSearchContext(SearchContext[] searchContext) { this.searchContext = searchContext; return this; } public Tweak[] getTweakHistory() { return tweakHistory; } public QueryGenerationRequest setTweakHistory(Tweak[] tweakHistory) { this.tweakHistory = tweakHistory; return this; } public String getAsk() { return ask; } public QueryGenerationRequest setAsk(String ask) { this.ask = ask; return this; } public String getUuid() { return uuid; } public QueryGenerationRequest setUuid(String uuid) { this.uuid = uuid; return this; } public String getDialect() { return dialect; } public QueryGenerationRequest setDialect(String dialect) { this.dialect = dialect; return this; } public String getParentUuid() { return parentUuid; } public QueryGenerationRequest setParentUuid(String parentUuid) { this.parentUuid = parentUuid; return this; } public Map<String, Object> getFlags() { return flags; } public QueryGenerationRequest setFlags(Map<String, Object> flags) { this.flags = flags; return this; } public Boolean getUseExampleQueries() { return useExampleQueries; } public QueryGenerationRequest setUseExampleQueries(Boolean useExampleQueries) { this.useExampleQueries = useExampleQueries; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/QueryPerformanceRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import com.google.gson.annotations.SerializedName; public class QueryPerformanceRequest { @SerializedName("query_id") private String queryId; public QueryPerformanceRequest(String queryId) { this.queryId = queryId; } public QueryPerformanceRequest() { } public String getQueryId() { return queryId; } public QueryPerformanceRequest setQueryId(String queryId) { this.queryId = queryId; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/QueryPerformanceResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; public class QueryPerformanceResponse { private List<String> summary; private List<String> recommendations; @SerializedName("query_text") private String queryText; @SerializedName("execution_time_ms") private Long executionTimeMs; @SerializedName("compilation_time_ms") private Long compilationTimeMs; public QueryPerformanceResponse(List<String> summary, List<String> recommendations, String queryText, Long executionTimeMs, Long compilationTimeMs) { this.summary = summary; this.recommendations = recommendations; this.queryText = queryText; this.executionTimeMs = executionTimeMs; this.compilationTimeMs = compilationTimeMs; } // Getters and Setters public List<String> getSummary() { return summary; } public void setSummary(List<String> summary) { this.summary = summary; } public List<String> getRecommendations() { return recommendations; } public void setRecommendations(List<String> recommendations) { this.recommendations = recommendations; } public String getQueryText() { return queryText; } public void setQueryText(String queryText) { this.queryText = queryText; } public Long getExecutionTimeMs() { return executionTimeMs; } public void setExecutionTimeMs(Long executionTimeMs) { this.executionTimeMs = executionTimeMs; } public Long getCompilationTimeMs() { return compilationTimeMs; } public void setCompilationTimeMs(Long compilationTimeMs) { this.compilationTimeMs = compilationTimeMs; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/RunQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.Map; import ai.waii.clients.database.SchemaName; public class RunQueryRequest { private String query; private String sessionId; private SchemaName currentSchema; private Map<String, Object> sessionParameters; public RunQueryRequest(String query, String sessionId, SchemaName currentSchema, Map<String, Object> sessionParameters) { this.query = query; this.sessionId = sessionId; this.currentSchema = currentSchema; this.sessionParameters = sessionParameters; } public RunQueryRequest() { } public String getQuery() { return query; } public RunQueryRequest setQuery(String query) { this.query = query; return this; } public String getSessionId() { return sessionId; } public RunQueryRequest setSessionId(String sessionId) { this.sessionId = sessionId; return this; } public SchemaName getCurrentSchema() { return currentSchema; } public RunQueryRequest setCurrentSchema(SchemaName currentSchema) { this.currentSchema = currentSchema; return this; } public Map<String, Object> getSessionParameters() { return sessionParameters; } public RunQueryRequest setSessionParameters(Map<String, Object> sessionParameters) { this.sessionParameters = sessionParameters; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/RunQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import java.util.Map; import com.google.gson.annotations.SerializedName; public class RunQueryResponse { @SerializedName("query_id") private String queryId; @SerializedName("error_details") private Map<String, Object> errorDetails; @SerializedName("detected_schemas") private List<String> detectedSchemas; public RunQueryResponse(String queryId, Map<String, Object> errorDetails, List<String> detectedSchemas) { this.queryId = queryId; this.errorDetails = errorDetails; this.detectedSchemas = detectedSchemas; } public String getQueryId() { return queryId; } public void setQueryId(String queryId) { this.queryId = queryId; } public Map<String, Object> getErrorDetails() { return errorDetails; } public void setErrorDetails(Map<String, Object> errorDetails) { this.errorDetails = errorDetails; } public List<String> getDetectedSchemas() { return detectedSchemas; } public void setDetectedSchemas(List<String> detectedSchemas) { this.detectedSchemas = detectedSchemas; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/SimilarQueryResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; public class SimilarQueryResponse { private Integer qid; private Boolean equivalent; private GeneratedQuery query; public SimilarQueryResponse(Integer qid, Boolean equivalent, GeneratedQuery query) { this.qid = qid; this.equivalent = equivalent; this.query = query; } public Integer getQid() { return qid; } public void setQid(Integer qid) { this.qid = qid; } public Boolean getEquivalent() { return equivalent; } public void setEquivalent(Boolean equivalent) { this.equivalent = equivalent; } public GeneratedQuery getQuery() { return query; } public void setQuery(GeneratedQuery query) { this.query = query; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/TranscodeQueryRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; import java.util.List; import com.google.gson.annotations.SerializedName; import ai.waii.clients.database.SearchContext; import waii.ai.clients.LLMBasedRequest; public class TranscodeQueryRequest extends LLMBasedRequest { @SerializedName("search_context") private List<SearchContext> searchContext; private String ask; @SerializedName("source_dialect") private String sourceDialect; @SerializedName("source_query") private String sourceQuery; @SerializedName("target_dialect") private String targetDialect; public TranscodeQueryRequest(List<SearchContext> searchContext, String ask, String sourceDialect, String sourceQuery, String targetDialect) { this.searchContext = searchContext; this.ask = ask; this.sourceDialect = sourceDialect; this.sourceQuery = sourceQuery; this.targetDialect = targetDialect; } public TranscodeQueryRequest() { } public List<SearchContext> getSearchContext() { return searchContext; } public TranscodeQueryRequest setSearchContext(List<SearchContext> searchContext) { this.searchContext = searchContext; return this; } public String getAsk() { return ask; } public TranscodeQueryRequest setAsk(String ask) { this.ask = ask; return this; } public String getSourceDialect() { return sourceDialect; } public TranscodeQueryRequest setSourceDialect(String sourceDialect) { this.sourceDialect = sourceDialect; return this; } public String getSourceQuery() { return sourceQuery; } public TranscodeQueryRequest setSourceQuery(String sourceQuery) { this.sourceQuery = sourceQuery; return this; } public String getTargetDialect() { return targetDialect; } public TranscodeQueryRequest setTargetDialect(String targetDialect) { this.targetDialect = targetDialect; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/query/Tweak.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.query; public class Tweak { private String sql; private String ask; public Tweak(String sql, String ask) { this.sql = sql; this.ask = ask; } public Tweak() { } public String getSql() { return sql; } public Tweak setSql(String sql) { this.sql = sql; return this; } public String getAsk() { return ask; } public Tweak setAsk(String ask) { this.ask = ask; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/GetSemanticContextRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; import com.google.gson.annotations.SerializedName; import waii.ai.clients.LLMBasedRequest; public class GetSemanticContextRequest extends LLMBasedRequest { private GetSemanticContextRequestFilter filter; @SerializedName("search_text") private String searchText; private int offset; private int limit; public GetSemanticContextRequestFilter getFilter() { return filter; } public GetSemanticContextRequest setFilter(GetSemanticContextRequestFilter filter) { this.filter = filter; return this; } public String getSearchText() { return searchText; } public GetSemanticContextRequest setSearchText(String searchText) { this.searchText = searchText; return this; } public int getOffset() { return offset; } public GetSemanticContextRequest setOffset(int offset) { this.offset = offset; return this; } public int getLimit() { return limit; } public GetSemanticContextRequest setLimit(int limit) { this.limit = limit; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/GetSemanticContextRequestFilter.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; import com.google.gson.annotations.SerializedName; public class GetSemanticContextRequestFilter { private String[] labels; private String scope; private String statement; @SerializedName("always_include") private boolean alwaysInclude; public String[] getLabels() { return labels; } public GetSemanticContextRequestFilter setLabels(String[] labels) { this.labels = labels; return this; } public String getScope() { return scope; } public GetSemanticContextRequestFilter setScope(String scope) { this.scope = scope; return this; } public String getStatement() { return statement; } public GetSemanticContextRequestFilter setStatement(String statement) { this.statement = statement; return this; } public boolean isAlwaysInclude() { return alwaysInclude; } public GetSemanticContextRequestFilter setAlwaysInclude(boolean alwaysInclude) { this.alwaysInclude = alwaysInclude; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/GetSemanticContextResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; import com.google.gson.annotations.SerializedName; public class GetSemanticContextResponse { @SerializedName("semantic_context") private SemanticStatement[] semanticContext; @SerializedName("available_statements") private int availableStatements; public SemanticStatement[] getSemanticContext() { return semanticContext; } public void setSemanticContext(SemanticStatement[] semanticContext) { this.semanticContext = semanticContext; } public int getAvailableStatements() { return availableStatements; } public void setAvailableStatements(int availableStatements) { this.availableStatements = availableStatements; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/ModifySemanticContextRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; public class ModifySemanticContextRequest { private SemanticStatement[] updated; private String[] deleted; public SemanticStatement[] getUpdated() { return updated; } public ModifySemanticContextRequest setUpdated(SemanticStatement[] updated) { this.updated = updated; return this; } public String[] getDeleted() { return deleted; } public ModifySemanticContextRequest setDeleted(String[] deleted) { this.deleted = deleted; return this; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/ModifySemanticContextResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; public class ModifySemanticContextResponse { private SemanticStatement[] updated; private String[] deleted; public SemanticStatement[] getUpdated() { return updated; } public void setUpdated(SemanticStatement[] updated) { this.updated = updated; } public String[] getDeleted() { return deleted; } public void setDeleted(String[] deleted) { this.deleted = deleted; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/SemanticContext.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; import java.io.IOException; import com.google.gson.Gson; import ai.waii.WaiiHttpClient; public class SemanticContext { private final WaiiHttpClient httpClient; private static final String MODIFY_ENDPOINT = "update-semantic-context"; private static final String GET_ENDPOINT = "get-semantic-context"; public SemanticContext(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public ModifySemanticContextResponse modifySemanticContext(ModifySemanticContextRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(MODIFY_ENDPOINT, jsonParams, ModifySemanticContextResponse.class); } public GetSemanticContextResponse getSemanticContext(GetSemanticContextRequest params) throws IOException { String jsonParams = new Gson().toJson(params); return this.httpClient.commonFetch(GET_ENDPOINT, jsonParams, GetSemanticContextResponse.class); } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/semanticcontext/SemanticStatement.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.semanticcontext; import java.util.UUID; import java.util.List; import com.google.gson.annotations.SerializedName; public class SemanticStatement { private String id; private String scope; private String statement; private String[] labels; @SerializedName("always_include") private Boolean alwaysInclude; @SerializedName("lookup_summaries") private String[] lookupSummaries; @SerializedName("summarization_prompt") private String summarizationPrompt; private Boolean critical; @SerializedName("additional_context") private Boolean additionalContext; private Boolean enabled; private List<SemanticStatementWarning> warnings; @SerializedName("user_id") private String userId; @SerializedName("tenant_id") private String tenantId; @SerializedName("org_id") private String orgId; public SemanticStatement() { this.scope = "*"; this.labels = new String[]{}; this.alwaysInclude = true; this.lookupSummaries = new String[]{}; this.summarizationPrompt = ""; this.id = UUID.randomUUID().toString(); this.critical = false; this.enabled = true; this.warnings = null; this.userId = "*"; this.tenantId = "*"; this.orgId = "*"; this.additionalContext= false; } public SemanticStatement( String scope, String statement, String[] labels, Boolean alwaysInclude, String[] lookupSummaries, String summarizationPrompt, String id, Boolean critical) { this.scope = scope; this.statement = statement; this.labels = labels; this.alwaysInclude = alwaysInclude; this.lookupSummaries = lookupSummaries; this.summarizationPrompt = summarizationPrompt; this.critical = critical; if (id != null && !id.isEmpty()) { this.id = id; } else { this.id = UUID.randomUUID().toString(); } this.enabled = true; this.warnings = null; this.userId = "*"; this.tenantId = "*"; this.orgId = "*"; } public String getId() { return id; } public SemanticStatement setId(String id) { this.id = id; return this; } public String getScope() { return scope; } public SemanticStatement setScope(String scope) { this.scope = scope; return this; } public String getStatement() { return statement; } public SemanticStatement setStatement(String statement) { this.statement = statement; return this; } public String[] getLabels() { return labels; } public SemanticStatement setLabels(String[] labels) { this.labels = labels; return this; } public Boolean getAlwaysInclude() { return alwaysInclude; } public SemanticStatement setAlwaysInclude(Boolean alwaysInclude) { this.alwaysInclude = alwaysInclude; return this; } public Boolean getCritical() { return critical; } public SemanticStatement setCritical(Boolean critical) { this.critical = critical; return this; } public String[] getLookupSummaries() { return lookupSummaries; } public SemanticStatement setLookupSummaries(String[] lookupSummaries) { this.lookupSummaries = lookupSummaries; return this; } public String getSummarizationPrompt() { return summarizationPrompt; } public SemanticStatement setSummarizationPrompt(String summarizationPrompt) { this.summarizationPrompt = summarizationPrompt; return this; } public Boolean getEnabled() { return enabled; } public SemanticStatement setEnabled(Boolean enabled) { this.enabled = enabled; return this; } public List<SemanticStatementWarning> getWarnings() { return warnings; } public SemanticStatement setWarnings(List<SemanticStatementWarning> warnings) { this.warnings = warnings; return this; } public String getUserId() { return userId; } public SemanticStatement setUserId(String userId) { this.userId = userId; return this; } public String getTenantId() { return tenantId; } public SemanticStatement setTenantId(String tenantId) { this.tenantId = tenantId; return this; } public String getOrgId() { return orgId; } public SemanticStatement setOrgId(String orgId) { this.orgId = orgId; return this; } public Boolean getAdditionalContext() { return additionalContext; } public void setAdditionalContext(Boolean additionalContext) { this.additionalContext = additionalContext; } public static class SemanticStatementWarning { private String message; private String type; public SemanticStatementWarning() { } public SemanticStatementWarning(String message, String type) { this.message = message; this.type = type; } public String getMessage() { return message; } public SemanticStatementWarning setMessage(String message) { this.message = message; return this; } public String getType() { return type; } public SemanticStatementWarning setType(String type) { this.type = type; return this; } } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/user/GetUserInfoRequest.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.user; public class GetUserInfoRequest { }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/user/GetUserInfoResponse.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.user; public class GetUserInfoResponse { private String name; private String email; private String[] roles; private String[] permissions; public String getName() { return name; } public void setName(String name) { this.name = name; } public String getEmail() { return email; } public void setEmail(String email) { this.email = email; } public String[] getRoles() { return roles; } public void setRoles(String[] roles) { this.roles = roles; } public String[] getPermissions() { return permissions; } public void setPermissions(String[] permissions) { this.permissions = permissions; } }
0
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients
java-sources/ai/waii/waii-sdk-java/1.31.1/ai/waii/clients/user/User.java
/* * Copyright 2023-2025 Waii, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package ai.waii.clients.user; import java.io.IOException; import com.google.gson.Gson; import ai.waii.WaiiHttpClient; public class User { private final WaiiHttpClient httpClient; private static final String GET_ENDPOINT = "get-user-info"; public User(WaiiHttpClient httpClient) { this.httpClient = httpClient; } public GetUserInfoResponse getInfo(GetUserInfoRequest params) throws IOException { String jsonParams = new Gson().toJson(params); // Assuming params might later include fields return this.httpClient.commonFetch(GET_ENDPOINT, jsonParams, GetUserInfoResponse.class); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/discovery/RegistrationManager.java
package ai.wanaku.api.discovery; /** * The `RegistrationManager` interface defines the contract for a class responsible for managing the lifecycle * registration of a capability service within the Wanaku ecosystem. * * <p>Implementations of this interface handle the processes of registering, deregistering, * and monitoring the status of a service's registration. It acts as the primary interface * for a capability service to interact with the Wanaku registration mechanism.</p> */ public interface RegistrationManager { /** * Registers the capability service with Wanaku */ void register(); /** * Deregisters the capability service from the Wanaku registration system. * This method notifies the registry that the service is no longer available * or is shutting down, allowing for proper cleanup and resource release. */ void deregister(); /** * Sends a "ping" or heartbeat signal to the Wanaku registration system. * This method is used to periodically inform the registry that the service is still active * and operational, preventing its registration from expiring due to inactivity. */ void ping(); /** * Notifies the Wanaku registration system that the last attempted operation (tool call * or resource acquisition) from this service failed. * * @param reason A descriptive string explaining the reason for the failure. * This information can be used for logging, debugging, or alerting purposes * by the registration system. */ void lastAsFail(String reason); /** * Notifies the Wanaku registration system that the last attempted operation (tool call * or resource acquisition) from this service was successful. * This method can be used to update the service's status within the registry, * indicating its continued health and availability. */ void lastAsSuccessful(); }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/ConfigurationNotFoundException.java
package ai.wanaku.api.exceptions; /** * This exception can be thrown if a configuration is expected in some way, but it is not found. */ public class ConfigurationNotFoundException extends WanakuException { /** * Constructs a new instance of this exception without a message or cause. */ public ConfigurationNotFoundException() { } /** * Constructs a new instance of this exception with the specified detail message. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) */ public ConfigurationNotFoundException(String message) { super(message); } /** * Constructs a new instance of this exception with the specified detail message and cause. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) */ public ConfigurationNotFoundException(String message, Throwable cause) { super(message, cause); } /** * Constructs a new instance of this exception with the specified cause. * * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) */ public ConfigurationNotFoundException(Throwable cause) { super(cause); } /** * Constructs a new instance of this exception with the specified detail message, cause, * enable suppression and writable stack trace. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) * @param enableSuppression whether suppression is enabled * @param writableStackTrace whether stack traces should be writtable */ public ConfigurationNotFoundException( String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Creates a new instance of this exception for the given tool name. * * @param toolName the name of the tool that was not found * @return a new instance of this exception with a message indicating that the tool was not found */ public static ConfigurationNotFoundException forName(String toolName) { return new ConfigurationNotFoundException(String.format("Tool %s not found", toolName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/InvalidResponseTypeException.java
package ai.wanaku.api.exceptions; /** * This exception can be thrown if a response of certain type is expected, but it came differently. * * Typically used to indicate that an API or service returned a response in an unexpected format, * such as an Integer object instead of String, or vice versa. */ public class InvalidResponseTypeException extends WanakuException { /** * Constructs a new instance of this exception without a message or cause. */ public InvalidResponseTypeException() { } /** * Constructs a new instance of this exception with the specified detail message. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) */ public InvalidResponseTypeException(String message) { super(message); } /** * Constructs a new instance of this exception with the specified detail message and cause. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) */ public InvalidResponseTypeException(String message, Throwable cause) { super(message, cause); } /** * Constructs a new instance of this exception with the specified cause. * * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) */ public InvalidResponseTypeException(Throwable cause) { super(cause); } /** * Constructs a new instance of this exception with the specified detail message, cause, * enable suppression and writable stack trace. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) * @param enableSuppression whether suppression is enabled * @param writableStackTrace whether stack traces should be writtable */ public InvalidResponseTypeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Creates a new instance of this exception for the given tool name. * * Note that this method is incorrectly named - it should probably be renamed to something like * {@code forResponseType} or similar. This will throw an exception with a message indicating * that the response type was not found. * * @param toolName the name of the tool (or response type) that was expected but not found * @return a new instance of this exception with a message indicating that the response type was not found */ public static InvalidResponseTypeException forName(String toolName) { return new InvalidResponseTypeException(String.format("Tool %s not found", toolName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/NonConvertableResponseException.java
package ai.wanaku.api.exceptions; /** * This exception can be thrown if a response is not convertible to the required type. * * Typically used when attempting to deserialize or convert a response from a service or API, * but encountering issues due to mismatched types, formats, or other errors. */ public class NonConvertableResponseException extends WanakuException { /** * Constructs a new instance of this exception without a message or cause. */ public NonConvertableResponseException() { } /** * Constructs a new instance of this exception with the specified detail message. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) */ public NonConvertableResponseException(String message) { super(message); } /** * Constructs a new instance of this exception with the specified detail message and cause. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) */ public NonConvertableResponseException(String message, Throwable cause) { super(message, cause); } /** * Constructs a new instance of this exception with the specified cause. * * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) */ public NonConvertableResponseException(Throwable cause) { super(cause); } /** * Constructs a new instance of this exception with the specified detail message, cause, * enable suppression and writable stack trace. * * @param message the detail message (which is saved for later retrieval by the {@link #getMessage()} method) * @param cause the cause (which is saved for later retrieval by the {@link #getCause()} method) * @param enableSuppression whether or not suppression is enabled * @param writableStackTrace whether or not stack traces should be writtable */ public NonConvertableResponseException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Creates a new instance of this exception for the given tool name. * * Note that this method is incorrectly named - it should probably be renamed to something like * {@code forResponseType} or similar. This will throw an exception with a message indicating * that the response was not convertible to the required type. * * @param toolName the name of the tool (or response) that could not be converted to the required type * @return a new instance of this exception with a message indicating that the response was not convertible */ public static NonConvertableResponseException forName(String toolName) { return new NonConvertableResponseException(String.format("Tool %s not found", toolName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/ResourceNotFoundException.java
package ai.wanaku.api.exceptions; /** * This exception can be thrown if the resource is not found. * * This custom exception extends {@link WanakuException} and provides a * clear indication of when a requested resource cannot be located or accessed. */ public class ResourceNotFoundException extends WanakuException { /** * Default constructor for the exception, providing no additional information. */ public ResourceNotFoundException() { } /** * Constructor that allows specifying a custom error message for the exception. * * @param message The detailed message describing why the resource was not found. */ public ResourceNotFoundException(String message) { super(message); } /** * Constructor that provides both a custom error message and an underlying cause for the exception. * * @param message The detailed message describing why the resource was not found. * @param cause The root cause of the exception, providing additional context. */ public ResourceNotFoundException(String message, Throwable cause) { super(message, cause); } /** * Constructor that specifies an underlying cause for the exception without a custom error message. * * @param cause The root cause of the exception, providing additional context. */ public ResourceNotFoundException(Throwable cause) { super(cause); } /** * Constructor that allows specifying both a custom error message and an underlying cause for the exception, * along with options to enable suppression or writable stack trace. * * @param message The detailed message describing why the resource was not found. * @param cause The root cause of the exception, providing additional context. * @param enableSuppression Whether to allow suppressing this exception during exception propagation. * @param writableStackTrace Whether to include a stack trace with this exception. */ public ResourceNotFoundException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Factory method that creates a new instance of the exception for a given resource name, * providing a pre-formatted error message indicating that the resource was not found. * * @param resourceName The name or identifier of the resource that was not found. * @return A new instance of the {@link ResourceNotFoundException} class with a custom error message. */ public static ResourceNotFoundException forName(String resourceName) { return new ResourceNotFoundException(String.format("Resource %s not found", resourceName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/ServiceNotFoundException.java
package ai.wanaku.api.exceptions; /** * This exception is thrown when a specified service cannot be located or does not exist. * * @see WanakuException */ public class ServiceNotFoundException extends WanakuException { /** * Constructs an instance of the exception with no detail message or cause. */ public ServiceNotFoundException() { super(); } /** * Constructs an instance of the exception with a specified detail message. * * @param message the detail message for this exception */ public ServiceNotFoundException(String message) { super(message); } /** * Constructs an instance of the exception with a specified cause and a detail message. * * @param message the detail message for this exception * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) */ public ServiceNotFoundException(String message, Throwable cause) { super(message, cause); } /** * Constructs an instance of the exception with a specified cause. * * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) */ public ServiceNotFoundException(Throwable cause) { super(cause); } /** * Constructs an instance of the exception with a specified detail message, cause, suppression enabled or disabled, * and writable stack trace enabled or disabled. * * @param message the detail message for this exception * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) * @param enableSuppression whether suppression is enabled or disabled * @param writableStackTrace whether the stack trace should be writable */ public ServiceNotFoundException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Returns a new instance of this exception with a formatted string indicating that a service could not be found. * * @param serviceName the name of the missing service * @return a new instance of this exception for the specified service name */ public static ServiceNotFoundException forName(String serviceName) { return new ServiceNotFoundException(String.format("Service %s not found", serviceName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/ServiceUnavailableException.java
package ai.wanaku.api.exceptions; /** * This exception is thrown when a specified service is not available. * * @see WanakuException */ public class ServiceUnavailableException extends WanakuException { /** * Constructs an instance of the exception with no detail message or cause. */ public ServiceUnavailableException() { super(); } /** * Constructs an instance of the exception with a specified detail message. * * @param message the detail message for this exception */ public ServiceUnavailableException(String message) { super(message); } /** * Constructs an instance of the exception with a specified cause and a detail message. * * @param message the detail message for this exception * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) */ public ServiceUnavailableException(String message, Throwable cause) { super(message, cause); } /** * Constructs an instance of the exception with a specified cause. * * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) */ public ServiceUnavailableException(Throwable cause) { super(cause); } /** * Constructs an instance of the exception with a specified detail message, cause, suppression enabled or disabled, * and writable stack trace enabled or disabled. * * @param message the detail message for this exception * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) * @param enableSuppression whether suppression is enabled or disabled * @param writableStackTrace whether the stack trace should be writable */ public ServiceUnavailableException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Returns a new instance of this exception with a formatted string indicating that a service could not be found. * * @param serviceName the name of the missing service * @return a new instance of this exception for the specified service name */ public static ServiceUnavailableException forName(String serviceName) { return new ServiceUnavailableException(String.format("Service is not available at %s", serviceName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/ToolNotFoundException.java
package ai.wanaku.api.exceptions; /** * This exception is thrown when a specified tool cannot be located or does not exist. * @see WanakuException */ public class ToolNotFoundException extends WanakuException { /** * Constructs an instance of the exception with no detail message or cause. */ public ToolNotFoundException() { super(); } /** * Constructs an instance of the exception with a specified detail message. * * @param message the detail message for this exception */ public ToolNotFoundException(String message) { super(message); } /** * Constructs an instance of the exception with a specified cause and a detail message. * * @param message the detail message for this exception * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) */ public ToolNotFoundException(String message, Throwable cause) { super(message, cause); } /** * Constructs an instance of the exception with a specified cause. * * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) */ public ToolNotFoundException(Throwable cause) { super(cause); } /** * Constructs an instance of the exception with a specified detail message, cause, suppression enabled or disabled, * and writable stack trace enabled or disabled. * * @param message the detail message for this exception * @param cause the cause (which is saved for later retrieval by the {@link Throwable#getCause()} method) * @param enableSuppression whether or not suppression is enabled or disabled * @param writableStackTrace whether or not the stack trace should be writable */ public ToolNotFoundException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } /** * Returns a new instance of this exception with a formatted string indicating that a tool could not be found. * * @param toolName the name of the missing tool * @return a new instance of this exception for the specified tool name */ public static ToolNotFoundException forName(String toolName) { return new ToolNotFoundException(String.format("Tool %s not found", toolName)); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/exceptions/WanakuException.java
package ai.wanaku.api.exceptions; /** * This is the base exception class. * * The {@link WanakuException} class extends the built-in {@link RuntimeException} to provide * a custom exception hierarchy. */ public class WanakuException extends RuntimeException { /** * Constructs an instance of this exception with no detail message or cause. * * This constructor provides a basic implementation for instances where no additional context is needed. */ public WanakuException() { super(); } /** * Constructs an instance of this exception with the specified detail message and without a cause. * * @param message The message describing the reason for this exception being thrown. */ public WanakuException(String message) { super(message); } /** * Constructs an instance of this exception with the specified detail message and underlying cause. * * @param message The message describing the reason for this exception being thrown. * @param cause The root cause that led to this exception being thrown. */ public WanakuException(String message, Throwable cause) { super(message, cause); } /** * Constructs an instance of this exception with the specified underlying cause but without a detail message. * * @param cause The root cause that led to this exception being thrown. */ public WanakuException(Throwable cause) { super(cause); } /** * Constructs an instance of this exception with the specified detail message and underlying cause, along with suppression flags. * * @param message The message describing the reason for this exception being thrown. * @param cause The root cause that led to this exception being thrown. * @param enableSuppression Whether to suppress the reporting of this exception's cause. * @param writableStackTrace Whether to make the stack trace associated with this exception writable. */ public WanakuException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace) { super(message, cause, enableSuppression, writableStackTrace); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/CallableReference.java
package ai.wanaku.api.types; /** * Represents a reference that can be called, providing metadata and input schema information. * * A callable reference is an abstraction of an object or function that can be invoked, * potentially with arguments. This interface provides methods to retrieve its name, description, * data type, and input schema. * */ public interface CallableReference { /** * Returns the name of this callable reference. * * @return The name of this callable reference. */ String getName(); /** * Returns a human-readable description of this callable reference. * * @return A human-readable description of this callable reference. */ String getDescription(); /** * Returns the data type associated with this callable reference. * * @return The data type associated with this callable reference. */ String getType(); /** * Returns the input schema for this callable reference, describing its expected input structure and format. * * @return The input schema for this callable reference. */ InputSchema getInputSchema(); /** * Sets the namespace associated with this reference * @return */ String getNamespace(); }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/ForwardReference.java
package ai.wanaku.api.types; import java.util.Objects; /** * Represents a reference to a forward service. * * This class holds information about the address of the forward service, * allowing it to be easily accessed and modified. */ public class ForwardReference implements WanakuEntity<String> { private String id; private String name; private String address; private String namespace; /** * The name of the reference * @return name of the reference as a string */ public String getName() { return name; } /** * Sets the name of the reference * @param name the name of the reference as a string */ public void setName(String name) { this.name = name; } /** * Returns the address of the forward service. * * @return the address as a string */ public String getAddress() { return address; } /** * Sets the address of the forward service. * * @param address the new address to use for the forward service */ public void setAddress(String address) { this.address = address; } @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } public String getNamespace() { return namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } ForwardReference that = (ForwardReference) o; return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals( address, that.address) && Objects.equals(namespace, that.namespace); } @Override public int hashCode() { return Objects.hash(id, name, address, namespace); } @Override public String toString() { return "ForwardReference{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", address='" + address + '\'' + ", namespace='" + namespace + '\'' + '}'; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/InputSchema.java
package ai.wanaku.api.types; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; /** * Represents the input schema for a tool, including type, properties, and required fields. */ public class InputSchema { private String type; private Map<String, Property> properties = new HashMap<>(); private List<String> required; /** * Gets the type of the input schema. * * @return the type of the input schema */ public String getType() { return type; } /** * Sets the type of the input schema. * * @param type the new type of the input schema */ public void setType(String type) { this.type = type; } /** * Gets the properties of the input schema. * * @return a map of property names to Property objects */ public Map<String, Property> getProperties() { return properties; } /** * Sets the properties of the input schema. * * @param properties a map of property names to Property objects */ public void setProperties(Map<String, Property> properties) { this.properties = properties; } /** * Gets the list of required fields in the input schema. * * @return a list of required field names */ public List<String> getRequired() { return required; } /** * Sets the list of required fields in the input schema. * * @param required a list of required field names */ public void setRequired(List<String> required) { this.required = required; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } InputSchema that = (InputSchema) o; return Objects.equals(type, that.type) && Objects.equals(properties, that.properties) && Objects.equals(required, that.required); } @Override public int hashCode() { return Objects.hash(type, properties, required); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/NameNamespacePair.java
package ai.wanaku.api.types; public record NameNamespacePair(String name, String namespace) { }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/Namespace.java
package ai.wanaku.api.types; public class Namespace implements WanakuEntity<String> { private String id; private String name; private String path; @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } public String getName() { return name; } public void setName(String name) { this.name = name; } public String getPath() { return path; } public void setPath(String path) { this.path = path; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/Property.java
package ai.wanaku.api.types; import java.util.Objects; /** * Represents a single property in the input schema. */ public class Property { private String type; private String description; private String target; private String scope; private String value; /** * Gets the type of the property. * * @return the type of the property */ public String getType() { return type; } /** * Sets the type of the property. * * @param type the new type of the property */ public void setType(String type) { this.type = type; } /** * Gets the description of the property. * * @return the description of the property */ public String getDescription() { return description; } /** * Sets the description of the property. * * @param description the new description of the property */ public void setDescription(String description) { this.description = description; } /** * Gets the target of the property. * * @return the description of the property */ public String getTarget() { return target; } /** * Sets the target of the property. * * @param target the new target of the property */ public void setTarget(String target) { this.target = target; } /** * Gets the scope of the property. * * @return the scope of the property */ public String getScope() { return scope; } /** * Sets the scope of the property. * * @param scope the new scope of the property */ public void setScope(String scope) { this.scope = scope; } /** * Gets the value of the property. * * @return the value of the property */ public String getValue() { return value; } /** * Sets the value of the property. * * @param value the new value of the property */ public void setValue(String value) { this.value = value; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } Property that = (Property) o; return Objects.equals(type, that.type) && Objects.equals(description, that.description) && Objects.equals(target, that.target) && Objects.equals(scope, that.scope) && Objects.equals(value, that.value); } @Override public int hashCode() { return Objects.hash(type, description, target, scope, value); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/RemoteToolReference.java
package ai.wanaku.api.types; import java.util.Objects; /** * This class represents a reference to a tool with various attributes such as name, description, URI, type, and input schema. */ public class RemoteToolReference implements CallableReference, WanakuEntity<String> { private String id; private String name; private String description; private String type; private InputSchema inputSchema; private String namespace; /** * Gets the name of the tool. * * @return the name of the tool */ @Override public String getName() { return name; } /** * Sets the name of the tool. * * @param name the new name of the tool */ public void setName(String name) { this.name = name; } /** * Gets the description of the tool. * * @return the description of the tool */ @Override public String getDescription() { return description; } /** * Sets the description of the tool. * * @param description the new description of the tool */ public void setDescription(String description) { this.description = description; } /** * Gets the type of the tool reference. * * @return the type of the tool reference */ @Override public String getType() { return type; } /** * Sets the type of the tool reference and returns the current object for method chaining. * * @param type the new type of the tool reference */ public void setType(String type) { this.type = type; } /** * Gets the input schema of the tool reference. * * @return the input schema of the tool reference */ @Override public InputSchema getInputSchema() { return inputSchema; } /** * Sets the input schema of the tool reference. * * @param inputSchema the new input schema of the tool reference */ public void setInputSchema(InputSchema inputSchema) { this.inputSchema = inputSchema; } @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } RemoteToolReference that = (RemoteToolReference) o; return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals( description, that.description) && Objects.equals(type, that.type) && Objects.equals(inputSchema, that.inputSchema); } @Override public int hashCode() { return Objects.hash(id, name, description, type, inputSchema); } @Override public String toString() { return "RemoteToolReference{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + ", type='" + type + '\'' + ", inputSchema=" + inputSchema + '}'; } public static ToolReference asToolReference(RemoteToolReference ref) { ToolReference ret = new ToolReference(); ret.setDescription(ref.getDescription()); ret.setInputSchema(ref.getInputSchema()); ret.setName(ref.getName()); ret.setType(ref.getType()); ret.setUri("<remote>"); ret.setId(ref.getId()); return ret; } @Override public String getNamespace() { return namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/ResourceReference.java
package ai.wanaku.api.types; import java.util.List; import java.util.Objects; /** * Represents a resource reference, containing details such as location, type, and parameters. */ public class ResourceReference implements WanakuEntity<String> { private String id; /** * The location of the resource (e.g., URL, file path). */ private String location; /** * The type of the resource (e.g., image, text, binary). */ private String type; /** * A brief name for the resource. */ private String name; /** * A longer description of the resource. */ private String description; /** * The MIME type of the resource (e.g., image/jpeg, text/plain). */ private String mimeType; /** * A list of parameters associated with the resource. */ private List<Param> params; private String configurationURI; private String secretsURI; private String namespace; public String getLocation() { return location; } /** * Sets the location of the resource. * * @param location The new location of the resource. */ public void setLocation(String location) { this.location = location; } public String getType() { return type; } /** * Sets the type of the resource. * * @param type The new type of the resource. */ public void setType(String type) { this.type = type; } public String getName() { return name; } /** * Sets a brief name for the resource. * * @param name The new name of the resource. */ public void setName(String name) { this.name = name; } public String getDescription() { return description; } /** * Sets a longer description of the resource. * * @param description The new description of the resource. */ public void setDescription(String description) { this.description = description; } public String getMimeType() { return mimeType; } /** * Sets the MIME type of the resource. * * @param mimeType The new MIME type of the resource. */ public void setMimeType(String mimeType) { this.mimeType = mimeType; } public List<Param> getParams() { return params; } /** * Sets a list of parameters associated with the resource. * * @param params The new list of parameters for the resource. */ public void setParams(List<Param> params) { this.params = params; } public String getConfigurationURI() { return configurationURI; } public void setConfigurationURI(String configurationURI) { this.configurationURI = configurationURI; } public String getSecretsURI() { return secretsURI; } public void setSecretsURI(String secretsURI) { this.secretsURI = secretsURI; } public String getNamespace() { return namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } /** * A nested class representing a parameter of the resource. */ public static class Param { /** * The name of the parameter (e.g. "key", "value"). */ private String name; /** * The value of the parameter. */ private String value; public String getName() { return name; } /** * Sets the name of the parameter. * * @param name The new name of the parameter. */ public void setName(String name) { this.name = name; } public String getValue() { return value; } /** * Sets the value of the parameter. * * @param value The new value of the parameter. */ public void setValue(String value) { this.value = value; } } @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } @Override public String toString() { return "ResourceReference{" + "id='" + id + '\'' + ", location='" + location + '\'' + ", type='" + type + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + ", mimeType='" + mimeType + '\'' + ", params=" + params + ", configurationURI='" + configurationURI + '\'' + ", secretsURI='" + secretsURI + '\'' + ", namespace='" + namespace + '\'' + '}'; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } ResourceReference that = (ResourceReference) o; return Objects.equals(id, that.id) && Objects.equals(location, that.location) && Objects.equals(type, that.type) && Objects.equals(name, that.name) && Objects.equals(description, that.description) && Objects.equals(mimeType, that.mimeType) && Objects.equals(params, that.params) && Objects.equals(configurationURI, that.configurationURI) && Objects.equals(secretsURI, that.secretsURI) && Objects.equals( namespace, that.namespace); } @Override public int hashCode() { return Objects.hash(id, location, type, name, description, mimeType, params, configurationURI, secretsURI, namespace); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/ToolReference.java
package ai.wanaku.api.types; import java.util.Objects; /** * This class represents a reference to a tool with various attributes such as name, description, URI, type, and input schema. */ public class ToolReference implements CallableReference, WanakuEntity<String> { private String id; private String name; private String description; private String uri; private String type; private InputSchema inputSchema; private String namespace; private String configurationURI; private String secretsURI; /** * Gets the name of the tool. * * @return the name of the tool */ @Override public String getName() { return name; } /** * Sets the name of the tool. * * @param name the new name of the tool */ public void setName(String name) { this.name = name; } /** * Gets the description of the tool. * * @return the description of the tool */ @Override public String getDescription() { return description; } /** * Sets the description of the tool. * * @param description the new description of the tool */ public void setDescription(String description) { this.description = description; } /** * Gets the URI of the tool reference. * * @return the URI of the tool reference */ public String getUri() { return uri; } /** * Sets the URI of the tool reference and returns the current object for method chaining. * * @param uri the new URI of the tool reference * @return the current ToolReference object */ public ToolReference setUri(String uri) { this.uri = uri; return this; } /** * Gets the type of the tool reference. * * @return the type of the tool reference */ @Override public String getType() { return type; } /** * Sets the type of the tool reference and returns the current object for method chaining. * * @param type the new type of the tool reference * @return the current ToolReference object */ public ToolReference setType(String type) { this.type = type; return this; } /** * Gets the input schema of the tool reference. * * @return the input schema of the tool reference */ @Override public InputSchema getInputSchema() { return inputSchema; } /** * Sets the input schema of the tool reference. * * @param inputSchema the new input schema of the tool reference */ public void setInputSchema(InputSchema inputSchema) { this.inputSchema = inputSchema; } @Override public String getNamespace() { return namespace; } public void setNamespace(String namespace) { this.namespace = namespace; } /** * Gets the location for the tool configuration * @return */ public String getConfigurationURI() { return configurationURI; } public void setConfigurationURI(String configurationURI) { this.configurationURI = configurationURI; } /** * Gets the location for the secrets associated with this tool * @return */ public String getSecretsURI() { return secretsURI; } public void setSecretsURI(String secretsURI) { this.secretsURI = secretsURI; } @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } ToolReference that = (ToolReference) o; return Objects.equals(id, that.id) && Objects.equals(name, that.name) && Objects.equals( description, that.description) && Objects.equals(uri, that.uri) && Objects.equals(type, that.type) && Objects.equals(inputSchema, that.inputSchema) && Objects.equals(configurationURI, that.configurationURI) && Objects.equals(secretsURI, that.secretsURI); } @Override public int hashCode() { return Objects.hash(id, name, description, uri, type, inputSchema, configurationURI, secretsURI); } @Override public String toString() { return "ToolReference{" + "id='" + id + '\'' + ", name='" + name + '\'' + ", description='" + description + '\'' + ", uri='" + uri + '\'' + ", type='" + type + '\'' + ", inputSchema=" + inputSchema + ", configurations=" + configurationURI + ", secrets=" + secretsURI + '}'; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/WanakuEntity.java
package ai.wanaku.api.types; public interface WanakuEntity<K> { K getId(); void setId(K id); }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/WanakuError.java
package ai.wanaku.api.types; /** * Represents an error response from a WANAKU API or service. This class encapsulates an error message. * @param message the error message */ public record WanakuError(String message) { /** * Default constructor that initializes a {@link WanakuError} with no message. */ public WanakuError() { this(null); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/WanakuResponse.java
package ai.wanaku.api.types; /** * Represents a Wanaku response, which can contain either an error or data. * * @param <T> The type of the data in the response. * @param error An optional error to include in the response * @param data The data to include in the response. */ public record WanakuResponse<T>(WanakuError error, T data) { /** * Creates a new Wanaku response with no error and no data. */ public WanakuResponse() { this(null, null); } /** * Creates a new Wanaku response with the given error message and no data. * * @param error The error message to include in the response. */ public WanakuResponse(String error) { this(new WanakuError(error), null); } /** * Creates a new Wanaku response with no error and the given data. * * @param data The data to include in the response. */ public WanakuResponse(T data) { this(null, data); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/discovery/ActivityRecord.java
package ai.wanaku.api.types.discovery; import ai.wanaku.api.types.WanakuEntity; import java.time.Instant; import java.util.ArrayList; import java.util.List; import java.util.Objects; public class ActivityRecord implements WanakuEntity<String> { private String id; private Instant lastSeen; private boolean active; private List<ServiceState> states = new ArrayList<>(); @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } public Instant getLastSeen() { return lastSeen; } public void setLastSeen(Instant lastSeen) { this.lastSeen = lastSeen; } public boolean isActive() { return active; } public void setActive(boolean active) { this.active = active; } public List<ServiceState> getStates() { return states; } public void setStates(List<ServiceState> states) { this.states = states; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } ActivityRecord that = (ActivityRecord) o; return active == that.active && Objects.equals(id, that.id) && Objects.equals(lastSeen, that.lastSeen) && Objects.equals(states, that.states); } @Override public int hashCode() { return Objects.hash(id, lastSeen, active, states); } @Override public String toString() { return "ActivityRecord{" + "id='" + id + '\'' + ", lastSeen=" + lastSeen + ", active=" + active + ", states=" + states + '}'; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/discovery/ServiceState.java
package ai.wanaku.api.types.discovery; import java.time.Instant; import java.util.Objects; /** * Contains the state of the service for an specific point in time */ public class ServiceState { private Instant timestamp; private boolean healthy; private String reason; public ServiceState() { } /** * Saves the current state of the service * @param timestamp the current timestamp * @param healthy whether it is healthy (true for healthy, false otherwise) * @param reason Optional state message (ignored if healthy) */ public ServiceState(Instant timestamp, boolean healthy, String reason) { this.timestamp = timestamp; this.healthy = healthy; this.reason = reason; } public Instant getTimestamp() { return timestamp; } public void setTimestamp(Instant timestamp) { this.timestamp = timestamp; } public boolean isHealthy() { return healthy; } public void setHealthy(boolean healthy) { this.healthy = healthy; } public String getReason() { return reason; } public void setReason(String reason) { this.reason = reason; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } ServiceState that = (ServiceState) o; return healthy == that.healthy && Objects.equals(timestamp, that.timestamp) && Objects.equals(reason, that.reason); } @Override public int hashCode() { return Objects.hash(timestamp, healthy, reason); } @Override public String toString() { return "ServiceState{" + "timestamp=" + timestamp + ", healthy=" + healthy + ", reason='" + reason + '\'' + '}'; } public static ServiceState newHealthy() { return new ServiceState(Instant.now(), true, StandardMessages.HEALTHY); } public static ServiceState newUnhealthy(String reason) { return new ServiceState(Instant.now(), false, reason); } public static ServiceState newMissingInAction() { return new ServiceState(Instant.now(), false, StandardMessages.MISSING_IN_ACTION); } public static ServiceState newInactive() { return new ServiceState(Instant.now(), true, StandardMessages.AUTO_DEREGISTRATION); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/discovery/StandardMessages.java
package ai.wanaku.api.types.discovery; public final class StandardMessages { public static final String HEALTHY = "healthy"; public static final String MISSING_IN_ACTION = "missing in action"; public static final String AUTO_DEREGISTRATION = "inactive due to service auto-deregistration"; private StandardMessages() {} }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/io/ProvisionAwarePayload.java
package ai.wanaku.api.types.io; public interface ProvisionAwarePayload<T> { T getPayload(); String getConfigurationData(); String getSecretsData(); }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/io/ResourcePayload.java
package ai.wanaku.api.types.io; import ai.wanaku.api.types.ResourceReference; public class ResourcePayload implements ProvisionAwarePayload<ResourceReference> { private ResourceReference resourceReference; private String configurationData; private String secretsData; @Override public ResourceReference getPayload() { return resourceReference; } public void setPayload(ResourceReference resourceReference) { this.resourceReference = resourceReference; } @Override public String getConfigurationData() { return configurationData; } public void setConfigurationData(String configurationData) { this.configurationData = configurationData; } @Override public String getSecretsData() { return secretsData; } public void setSecretsData(String secretsData) { this.secretsData = secretsData; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/io/ToolPayload.java
package ai.wanaku.api.types.io; import ai.wanaku.api.types.ToolReference; public final class ToolPayload implements ProvisionAwarePayload<ToolReference> { private ToolReference toolReference; private String configurationData; private String secretsData; @Override public ToolReference getPayload() { return toolReference; } public void setPayload(ToolReference toolReference) { this.toolReference = toolReference; } @Override public String getConfigurationData() { return configurationData; } public void setConfigurationData(String configurationData) { this.configurationData = configurationData; } @Override public String getSecretsData() { return secretsData; } public void setSecretsData(String secretsData) { this.secretsData = secretsData; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/management/ServerInfo.java
package ai.wanaku.api.types.management; /** * Contains server information, such as the version of the server. * * This class encapsulates essential details about the server, making it * easy to access its configuration. */ public class ServerInfo { /** * The version of the server software or platform running on this instance. */ private String version; /** * Returns the current version of the server. * * @return The server version as a string. */ public String getVersion() { return version; } /** * Sets the version of the server to a new value. * * @param version The updated server version as a string. */ public void setVersion(String version) { this.version = version; } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/providers/ServiceTarget.java
package ai.wanaku.api.types.providers; import ai.wanaku.api.types.WanakuEntity; import java.util.Objects; /** * Represents a target service endpoint that can be either a resource provider or a tool invoker. * * This class encapsulates information about a service, including its target and configurations, * providing a structured way to represent and manage services in a system. */ public class ServiceTarget implements WanakuEntity<String> { private String id; private String service; private String host; private int port; private ServiceType serviceType; public ServiceTarget() { } /** * Constructs a new instance of {@link ServiceTarget}. * * @param service The name of the service. * @param host The host address of the service. * @param port The port number of the service. * @param serviceType The type of service, either RESOURCE_PROVIDER or TOOL_INVOKER. */ public ServiceTarget(String id, String service, String host, int port, ServiceType serviceType) { this.id = id; this.service = service; this.host = host; this.port = port; this.serviceType = serviceType; } /** * Gets the name of the service. * * @return The name of the service. */ public String getService() { return service; } /** * Gets the host address of the service. * * @return The host address of the service. */ public String getHost() { return host; } /** * Gets the port number of the service. * * @return The port number of the service. */ public int getPort() { return port; } /** * Gets the type of service, either RESOURCE_PROVIDER or TOOL_INVOKER. * * @return The type of service. */ public ServiceType getServiceType() { return serviceType; } /** * Returns a string representation of the service address in the format "host:port". * * @return A string representation of the service address. */ public String toAddress() { return String.format("%s:%d", host, port); } @Override public String getId() { return id; } @Override public void setId(String id) { this.id = id; } @Override public boolean equals(Object o) { if (o == null || getClass() != o.getClass()) { return false; } ServiceTarget that = (ServiceTarget) o; return port == that.port && Objects.equals(id, that.id) && Objects.equals(service, that.service) && Objects.equals(host, that.host) && serviceType == that.serviceType; } @Override public int hashCode() { return Objects.hash(id, service, host, port, serviceType); } @Override public String toString() { return "ServiceTarget{" + "id='" + id + '\'' + ", service='" + service + '\'' + ", host='" + host + '\'' + ", port=" + port + ", serviceType=" + serviceType + '}'; } /** * Creates a new instance of {@link ServiceTarget} with the specified parameters with the given service type. * * @param service The name of the service. * @param address The host address of the service. * @param port The port number of the service. * @return A new instance of {@link ServiceTarget}. */ public static ServiceTarget newEmptyTarget(String service, String address, int port, ServiceType serviceType) { return new ServiceTarget(null, service, address, port, serviceType); } }
0
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types
java-sources/ai/wanaku/api/0.0.7/ai/wanaku/api/types/providers/ServiceType.java
package ai.wanaku.api.types.providers; /** * Defines types of downstream services */ public enum ServiceType { /** * Provides resources */ RESOURCE_PROVIDER("resource-provider", 1), /** * Invokes tools */ TOOL_INVOKER("tool-invoker", 2); private final String value; private final int intValue; ServiceType(String value, int intValue) { this.value = value; this.intValue = intValue; } /** * The string value representing the service type * @return the string value representing the service type */ public String asValue() { return value; } public int intValue() { return intValue; } public static ServiceType fromIntValue(int value) { if (value == 1) { return RESOURCE_PROVIDER; } if (value == 2) { return TOOL_INVOKER; } throw new IllegalArgumentException("Invalid service type: " + value); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/CliMain.java
package ai.wanaku.cli.main; import ai.wanaku.cli.main.commands.BaseCommand; import jakarta.inject.Inject; import ai.wanaku.cli.main.commands.forwards.Forwards; import ai.wanaku.cli.main.commands.namespaces.Namespaces; import ai.wanaku.cli.main.commands.resources.Resources; import ai.wanaku.cli.main.commands.capabilities.Capabilities; import ai.wanaku.cli.main.commands.start.Start; import ai.wanaku.cli.main.commands.targets.Targets; import ai.wanaku.cli.main.commands.tools.Tools; import ai.wanaku.cli.main.commands.toolset.ToolSet; import ai.wanaku.core.util.VersionHelper; import io.quarkus.picocli.runtime.annotations.TopCommand; import io.quarkus.runtime.QuarkusApplication; import picocli.CommandLine; import java.util.concurrent.Callable; @TopCommand @CommandLine.Command(name = "wanaku", subcommands = { Forwards.class, Resources.class, Start.class, Capabilities.class, Targets.class, Tools.class, ToolSet.class, Namespaces.class }) public class CliMain implements Callable<Integer>, QuarkusApplication { @Inject CommandLine.IFactory factory; @CommandLine.Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the help and sub-commands") private boolean helpRequested = false; @CommandLine.Option(names = { "-v", "--version" }, description = "Display the current version of Wanaku CLI") private boolean versionRequested = false; @Override public int run(String... args) throws Exception { return new CommandLine(this, factory).execute(args); } @Override public Integer call() { if (versionRequested) { System.out.println("Wanaku CLI version " + VersionHelper.VERSION); } CommandLine.usage(this, System.out); return BaseCommand.EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/Main.java
package ai.wanaku.cli.main; import io.quarkus.runtime.Quarkus; import io.quarkus.runtime.annotations.QuarkusMain; @QuarkusMain public class Main { public static void main(String[] args) { Quarkus.run(CliMain.class, args); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/BaseCommand.java
package ai.wanaku.cli.main.commands; import ai.wanaku.cli.main.support.WanakuPrinter; import io.quarkus.rest.client.reactive.QuarkusRestClientBuilder; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.net.URI; import java.util.concurrent.Callable; public abstract class BaseCommand implements Callable<Integer> { public static final int EXIT_OK = 0; public static final int EXIT_ERROR = 1; @CommandLine.Option(names = { "-h", "--help" }, usageHelp = true, description = "Display the help and sub-commands") private boolean helpRequested = false; /** * Initializes and configures the REST client for communicating with the Wanaku service. * * <p>Creates a properly configured Quarkus REST client builder with the specified host URL. * The client is configured with appropriate timeouts and error handling for reliable * communication with the Wanaku API endpoints.</p> * * @param <T> the type of the service interface * @param clazz the Class object representing the service interface * @param host the base URL of the Wanaku service API (must be a valid URI) * @return a configured Service instance ready for API calls * @throws IllegalArgumentException if the host URL is invalid or malformed * @throws NullPointerException if host is null */ protected static <T> T initService(Class<T> clazz, String host) { if (host == null) { throw new NullPointerException("Host URL cannot be null"); } try { return QuarkusRestClientBuilder.newBuilder() .baseUri(URI.create(host)) .build(clazz); } catch (IllegalArgumentException e) { throw new IllegalArgumentException("Invalid host URL: " + host, e); } } @Override public Integer call() throws Exception { try (Terminal terminal = WanakuPrinter.terminalInstance() ) { WanakuPrinter printer = new WanakuPrinter(null, terminal); return doCall(terminal, printer); } } public abstract Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception; }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/Capabilities.java
package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.IOException; @CommandLine.Command(name = "capabilities", description = "Manage capabilities", subcommands = { CapabilitiesList.class, CapabilitiesCreate.class, CapabilitiesShow.class }) public class Capabilities extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/CapabilitiesBase.java
package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.api.exceptions.WanakuException; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.core.util.ProcessRunner; import ai.wanaku.core.util.VersionHelper; import java.io.File; import org.jboss.logging.Logger; import picocli.CommandLine; public abstract class CapabilitiesBase extends BaseCommand { private static final Logger LOG = Logger.getLogger(CapabilitiesBase.class); @CommandLine.Option(names = { "--name" }, description = "A human-readable name for the capability", required = true, arity = "0..1") protected String name; @CommandLine.Option(names = { "--wanaku-version" }, description = "Wanaku base version", arity = "0..1") protected String wanakuVersion; @CommandLine.Option(names = {"--path"}, description = "The project path", defaultValue = ".", arity = "0..1") protected String path; @CommandLine.Option(names = { "--type" }, description = "The capability type (camel, quarkus, etc)", defaultValue = "camel", required = true, arity = "0..1") protected String type; protected void createProject(String baseCmd, String basePackage, String baseArtifactId) { String version = wanakuVersion != null ? wanakuVersion : VersionHelper.VERSION; String packageName = String.format("%s.%s", basePackage, sanitizeName(name)); String cmd = String.format("%s -Dpackage=%s -DartifactId=%s-%s -Dname=%s -Dwanaku-version=%s -Dwanaku-capability-type=%s -DarchetypeVersion=%s", baseCmd, packageName, baseArtifactId, sanitizeName(name), capitalize(name), version, type, version); String[] split = cmd.split(" "); final File projectDir = new File(path); try { ProcessRunner.run(projectDir, split); } catch (WanakuException e) { LOG.error(e.getMessage(), e); System.exit(-1); } } private static String capitalize(String ret) { final char[] chars = ret.toCharArray(); // OK here. chars[0] = Character.toUpperCase(chars[0]); return replaceInvalid(new String(chars)); } private static String replaceInvalid(String name) { return name.replace("-", ""); } private static String sanitizeName(String name) { return replaceInvalid(name.toLowerCase()); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/CapabilitiesCreate.java
package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.IOException; @CommandLine.Command(name = "create",description = "Create a new capability", subcommands = { CapabilitiesCreateTool.class, CapabilitiesCreateResources.class}) public class CapabilitiesCreate extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { CommandLine.usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/CapabilitiesCreateResources.java
package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.cli.main.support.WanakuPrinter; import jakarta.inject.Inject; import ai.wanaku.cli.main.support.WanakuCliConfig; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import picocli.CommandLine; import java.io.IOException; @CommandLine.Command(name = "resource",description = "Create a new resource provider capability") public class CapabilitiesCreateResources extends CapabilitiesBase { private static final Logger LOG = Logger.getLogger(CapabilitiesCreateResources.class); @Inject WanakuCliConfig config; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { String baseCmd = config.resource().createCmd(); createProject(baseCmd, "ai.wanaku.provider", "wanaku-provider"); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/CapabilitiesCreateTool.java
package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.cli.main.support.WanakuCliConfig; import ai.wanaku.cli.main.support.WanakuPrinter; import jakarta.inject.Inject; import org.jboss.logging.Logger; import org.jline.terminal.Terminal; import java.io.IOException; import static picocli.CommandLine.Command; @Command(name = "tool",description = "Create a new tool service") public class CapabilitiesCreateTool extends CapabilitiesBase { private static final Logger LOG = Logger.getLogger(CapabilitiesCreateTool.class); @Inject WanakuCliConfig config; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { String baseCmd = config.tool().createCmd(); createProject(baseCmd, "ai.wanaku.tool", "wanaku-tool-service"); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/CapabilitiesList.java
// CapabilitiesList.java package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.TargetsService; import org.jline.terminal.Terminal; import java.io.IOException; import static ai.wanaku.cli.main.support.CapabilitiesHelper.API_TIMEOUT; import static ai.wanaku.cli.main.support.CapabilitiesHelper.fetchAndMergeCapabilities; import static ai.wanaku.cli.main.support.CapabilitiesHelper.printCapabilities; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; /** * Command-line interface for listing all service capabilities in the Wanaku system. * * <p>This command provides functionality to discover and display both management tools * and resource providers available in the system, along with their current status * and activity information. It combines data from multiple API endpoints to present * a unified view of system capabilities in a tabular format.</p> * * <p>The command supports the following functionality:</p> * <ul> * <li>Fetches management tools and resource providers from the API</li> * <li>Retrieves activity status for each service</li> * <li>Merges and correlates data from multiple sources</li> * <li>Displays results in a formatted table with columns for service, type, host, port, status, and last seen</li> * </ul> * * <p>Usage examples:</p> * <pre> * # List all capabilities using default host * wanaku capabilities list * * # List capabilities from a specific host * wanaku capabilities list --host http://api.example.com:8080 * </pre> * * <p>Output format:</p> * <pre> * service | serviceType | host | port | status | lastSeen * --------|-------------------|---------------|------|--------|---------- * http | tool-invoker | 192.168.1.101 | 9000 | active | Monday, June 23, 2025 at 07:00:26 * sqs | tool-invoker | 192.168.1.101 | 9011 | active | Monday, June 16, 2025 at 13:22:29 * </pre> * * @see CapabilitiesShow * @see ai.wanaku.cli.main.support.CapabilitiesHelper */ @Command(name = "list", description = "List all available capabilities") public class CapabilitiesList extends BaseCommand { /** * API host URL for connecting to the Wanaku services. * * <p>This option allows users to specify the base URL of the Wanaku API server. * The URL should include the protocol (http/https) and port if different from default.</p> * * <p>Examples of valid host URLs:</p> * <ul> * <li>http://localhost:8080 (default)</li> * <li>https://api.wanaku.ai</li> * <li>http://192.168.1.100:9090</li> * </ul> */ @Option( names = {"--host"}, description = "The API host URL (default: http://localhost:8080)", defaultValue = "http://localhost:8080") private String host; /** * REST client for communicating with the targets service API. * Initialized during command execution. */ private TargetsService targetsService; /** * Executes the capabilities listing command. * * <p>This method orchestrates the entire process of:</p> * <ol> * <li>Creating a terminal instance for output</li> * <li>Initializing the targets service with the specified host</li> * <li>Fetching and merging capabilities data from the API</li> * <li>Displaying the results in a formatted table</li> * </ol> * * <p>The method uses a try-with-resources block to ensure proper terminal cleanup * and includes timeout handling for API operations.</p> * * @return {@link BaseCommand#EXIT_OK} if the command executes successfully * @throws Exception if there's an error during execution, including: * <ul> * <li>API communication failures</li> * <li>Terminal creation issues</li> * <li>Data processing errors</li> * <li>Timeout while waiting for API responses</li> * </ul> */ @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { targetsService = initService(TargetsService.class, host); var capabilities = fetchAndMergeCapabilities(targetsService) .await() .atMost(API_TIMEOUT); printCapabilities(capabilities, printer); return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/capabilities/CapabilitiesShow.java
package ai.wanaku.cli.main.commands.capabilities; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.CapabilitiesHelper; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.TargetsService; import org.jline.consoleui.prompt.ConsolePrompt; import org.jline.consoleui.prompt.PromptResultItemIF; import org.jline.consoleui.prompt.builder.ListPromptBuilder; import org.jline.consoleui.prompt.builder.PromptBuilder; import org.jline.terminal.Terminal; import java.io.IOException; import java.util.List; import java.util.Map; import static ai.wanaku.cli.main.support.CapabilitiesHelper.API_TIMEOUT; import static ai.wanaku.cli.main.support.CapabilitiesHelper.fetchAndMergeCapabilities; import static ai.wanaku.cli.main.support.CapabilitiesHelper.printCapability; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; import static picocli.CommandLine.Parameters; /** * Command implementation for displaying detailed information about specific service capabilities. * * <p>This command retrieves and displays comprehensive details about capabilities for a specified * service. When multiple capabilities exist for the same service, it provides an interactive * selection interface allowing users to choose which specific capability instance to examine.</p> * * <p>The command supports filtering capabilities by service name and handles various scenarios:</p> * <ul> * <li>No capabilities found - displays warning message</li> * <li>Single capability - directly shows detailed information</li> * <li>Multiple capabilities - presents interactive selection menu</li> * </ul> * * <p>Example usage:</p> * <pre>{@code * wanaku capabilities show http * wanaku capabilities show --host http://remote:8080 sqs * }</pre> * * @author Wanaku CLI Team * @version 1.0 * @since 1.0 */ @Command(name = "show", description = "Show detailed information about a specific capability") public class CapabilitiesShow extends BaseCommand { /** * Default API host URL used when no host is explicitly specified. */ private static final String DEFAULT_HOST = "http://localhost:8080"; /** * Format string for displaying capability choices in the selection menu. * Displays service type, host, port, status, and last seen timestamp. */ private static final String CAPABILITY_CHOICE_FORMAT = "%-20s %-20s %-5d %-10s %-45s"; /** * Prompt name identifier used for the interactive capability selection. */ private static final String SELECTION_PROMPT_NAME = "index"; /** * The API host URL for connecting to the targets service. * Defaults to localhost:8080 if not specified. */ @Option( names = {"--host"}, description = "The API host URL (default: " + DEFAULT_HOST + ")", defaultValue = DEFAULT_HOST ) private String host; /** * The service name to show capability details for. * Must be exactly one service name (e.g., "http", "sqs", "file"). */ @Parameters( description = "The service name to show details for (e.g., http, sqs, file)", arity = "1..1" ) private String service; /** * Service instance for interacting with the targets API. * Initialized during command execution with the specified host configuration. */ private TargetsService targetsService; /** * Executes the capabilities show command. * * <p>This method orchestrates the entire capability retrieval and display process:</p> * <ol> * <li>Initializes the targets service with the specified host</li> * <li>Fetches all available capabilities from the API</li> * <li>Filters capabilities by the specified service name</li> * <li>Handles display based on the number of matching capabilities found</li> * </ol> * * @param terminal the terminal instance for user interaction * @param printer the printer instance for formatted output * @return {@link #EXIT_OK} on successful execution, {@link #EXIT_ERROR} on failure * @throws IOException if an I/O error occurs during API communication or terminal interaction * @throws Exception if any other error occurs during command execution */ @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { targetsService = initService(TargetsService.class, host); // Fetch and filter capabilities by service name List<CapabilitiesHelper.PrintableCapability> capabilities = fetchAndMergeCapabilities(targetsService) .await() .atMost(API_TIMEOUT) .stream() .filter(capability -> capability.service().equals(service)) .toList(); // Handle different capability count scenarios using enhanced switch expression return switch (capabilities.size()) { case 0 -> handleNoCapabilities(printer); case 1 -> handleSingleCapability(printer, capabilities.getFirst()); default -> handleMultipleCapabilities(terminal, printer, capabilities); }; } /** * Handles the scenario where no capabilities are found for the specified service. * * @param printer the printer instance for formatted output * @return {@link #EXIT_ERROR} to indicate no capabilities were found * @throws IOException if an error occurs while printing the warning message */ private Integer handleNoCapabilities(WanakuPrinter printer) throws IOException { printer.printWarningMessage("No capabilities found for service: " + service); return EXIT_ERROR; } /** * Handles the scenario where exactly one capability is found for the specified service. * Directly displays the capability details without requiring user selection. * * @param printer the printer instance for formatted output * @param capability the single capability to display * @return {@link #EXIT_OK} on successful display * @throws Exception if an error occurs while printing capability details */ private Integer handleSingleCapability(WanakuPrinter printer, CapabilitiesHelper.PrintableCapability capability) throws Exception { printCapabilityDetails(printer, capability); return EXIT_OK; } /** * Handles the scenario where multiple capabilities are found for the specified service. * * <p>Creates an interactive selection menu allowing the user to choose which specific * capability instance to examine. The menu displays key information about each capability * including service type, host, port, status, and last seen timestamp.</p> * * @param terminal the terminal instance for user interaction * @param printer the printer instance for formatted output * @param capabilities the list of capabilities to choose from * @return {@link #EXIT_OK} on successful selection and display, {@link #EXIT_ERROR} on failure * @throws Exception if an error occurs during user interaction or capability display */ private Integer handleMultipleCapabilities(Terminal terminal, WanakuPrinter printer, List<CapabilitiesHelper.PrintableCapability> capabilities) throws Exception { printer.printWarningMessage("Multiple capabilities found for the " + service + " service. Please choose one."); ConsolePrompt.UiConfig uiConfig = new ConsolePrompt.UiConfig("=> ", "[]", "[x]", "-"); ConsolePrompt prompt = new ConsolePrompt(terminal, uiConfig); PromptBuilder builder = prompt.getPromptBuilder(); // Create interactive selection prompt ListPromptBuilder listPromptBuilder = builder.createListPrompt() .name(SELECTION_PROMPT_NAME) .message("Select a capability instance:"); // Add each capability as a selectable option with formatted display text for (int i = 0; i < capabilities.size(); i++) { CapabilitiesHelper.PrintableCapability capability = capabilities.get(i); String displayText = formatCapabilityChoice(capability); listPromptBuilder .newItem(String.valueOf(i)) .text(displayText) .add(); } listPromptBuilder.addPrompt(); try { Map<String, PromptResultItemIF> result = prompt.prompt(builder.build()); int selectedIndex = Integer.parseInt(result.get(SELECTION_PROMPT_NAME).getResult()); printCapabilityDetails(printer, capabilities.get(selectedIndex)); return EXIT_OK; } catch (Exception e) { printer.printErrorMessage("Error during capability selection: " + e.getMessage()); return EXIT_ERROR; } } /** * Formats a capability for display in the selection menu. * * @param capability the capability to format * @return formatted string containing service type, host, port, status, and last seen information */ private String formatCapabilityChoice(CapabilitiesHelper.PrintableCapability capability) { return String.format(CAPABILITY_CHOICE_FORMAT, capability.serviceType(), capability.host(), capability.port(), capability.status(), capability.lastSeen()); } /** * Prints comprehensive details for a selected capability. * * <p>Displays both the basic capability information and its associated configurations * in a formatted table structure.</p> * * @param printer the printer instance for formatted output * @param capability the capability whose details should be printed * @throws Exception if an error occurs while printing the capability details or configurations */ private void printCapabilityDetails(WanakuPrinter printer, CapabilitiesHelper.PrintableCapability capability) throws Exception { printer.printInfoMessage("Capability Details:"); printCapability(capability, printer); printer.printInfoMessage("\nConfigurations:"); printer.printTable(capability.configurations(), "name", "description"); } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/forwards/Forwards.java
package ai.wanaku.cli.main.commands.forwards; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import org.jline.terminal.Terminal; import java.io.IOException; import static picocli.CommandLine.Command; import static picocli.CommandLine.usage; @Command(name = "forwards", description = "Manage forwards", subcommands = { ForwardsAdd.class, ForwardsRemove.class, ForwardsList.class }) public class Forwards extends BaseCommand { @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { usage(this, System.out); return EXIT_ERROR; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/forwards/ForwardsAdd.java
package ai.wanaku.cli.main.commands.forwards; import ai.wanaku.api.types.ForwardReference; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ForwardsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import picocli.CommandLine; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Command(name = "add", description = "Add forward targets") public class ForwardsAdd extends BaseCommand { @Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @Option(names = {"--name"}, description = "The name of the service to forward", required = true, arity = "0..1") protected String name; @Option(names = {"--service"}, description = "The service to forward", required = true, arity = "0..1") protected String service; @CommandLine.Option(names = {"-N", "--namespace"}, description="The namespace associated with the tool", defaultValue = "", required = true) private String namespace; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { ForwardsService forwardsService = initService(ForwardsService.class, host); ForwardReference reference = new ForwardReference(); reference.setName(name); reference.setAddress(service); reference.setNamespace(namespace); try (Response ignored = forwardsService.addForward(reference)) { } catch (WebApplicationException ex) { Response response = ex.getResponse(); commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/forwards/ForwardsList.java
package ai.wanaku.cli.main.commands.forwards; import ai.wanaku.api.types.ForwardReference; import ai.wanaku.api.types.WanakuResponse; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ForwardsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import java.io.IOException; import java.util.List; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Command(name = "list", description = "List forward targets") public class ForwardsList extends BaseCommand { @Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws IOException, Exception { ForwardsService forwardsService = initService(ForwardsService.class, host); try { WanakuResponse<List<ForwardReference>> wanakuResponseRestResponse = forwardsService.listForwards(); List<ForwardReference> data = wanakuResponseRestResponse.data(); printer.printTable(data, "name","address"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }
0
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands
java-sources/ai/wanaku/cli/0.0.7/ai/wanaku/cli/main/commands/forwards/ForwardsRemove.java
package ai.wanaku.cli.main.commands.forwards; import ai.wanaku.api.types.ForwardReference; import ai.wanaku.cli.main.commands.BaseCommand; import ai.wanaku.cli.main.support.WanakuPrinter; import ai.wanaku.core.services.api.ForwardsService; import jakarta.ws.rs.WebApplicationException; import jakarta.ws.rs.core.Response; import org.jline.terminal.Terminal; import static ai.wanaku.cli.main.support.ResponseHelper.commonResponseErrorHandler; import static picocli.CommandLine.Command; import static picocli.CommandLine.Option; @Command(name = "remove", description = "Remove forward targets") public class ForwardsRemove extends BaseCommand { @Option(names = {"--host"}, description = "The API host", defaultValue = "http://localhost:8080", arity = "0..1") protected String host; @Option(names = {"--name"}, description = "The name of the service to forward", required = true, arity = "0..1") protected String name; @Override public Integer doCall(Terminal terminal, WanakuPrinter printer) throws Exception { ForwardsService forwardsService = initService(ForwardsService.class, host); ForwardReference reference = new ForwardReference(); reference.setName(name); try (Response ignored = forwardsService.removeForward(reference)) { printer.printSuccessMessage("Successfully removed forward reference '" + reference.getName()+"'"); } catch (WebApplicationException ex) { Response response = ex.getResponse(); if (response.getStatus() == Response.Status.NOT_FOUND.getStatusCode()) { String warningMessage = String.format("Forward not found (%s): %s%n", name, response.getStatusInfo().getReasonPhrase()); printer.printWarningMessage(warningMessage); return EXIT_ERROR; } commonResponseErrorHandler(response); return EXIT_ERROR; } return EXIT_OK; } }