Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,6 @@ func New(options *Options) *API {

// Experimental routes are not guaranteed to be stable and may change at any time.
r.Route("/api/experimental", func(r chi.Router) {
api.ExperimentalHandler = r

r.NotFound(func(rw http.ResponseWriter, _ *http.Request) { httpapi.RouteNotFound(rw) })
r.Use(
// Specific routes can specify different limits, but every rate
Expand Down Expand Up @@ -1828,8 +1826,6 @@ type API struct {

// APIHandler serves "/api/v2"
APIHandler chi.Router
// ExperimentalHandler serves "/api/experimental"
ExperimentalHandler chi.Router
// RootHandler serves "/"
RootHandler chi.Router

Expand Down
6 changes: 0 additions & 6 deletions enterprise/coderd/coderd.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,12 +226,6 @@ func New(ctx context.Context, options *Options) (_ *API, err error) {
return api.refreshEntitlements(ctx)
}

api.AGPL.ExperimentalHandler.Group(func(r chi.Router) {
// Deprecated.
// TODO: remove with Beta release.
r.Route("/aibridge", aibridgeHandler(api, apiKeyMiddleware))
})

api.AGPL.APIHandler.Group(func(r chi.Router) {
r.Route("/aibridge", aibridgeHandler(api, apiKeyMiddleware))
})
Expand Down
37 changes: 17 additions & 20 deletions site/src/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2744,6 +2744,23 @@ class ApiMethods {
setTimeout(() => res(), 500);
});
};

getAIBridgeInterceptions = async (options: SearchParamOptions) => {
const url = getURLWithSearchParams(
"/api/v2/aibridge/interceptions",
options,
);
const response =
await this.axios.get<TypesGen.AIBridgeListInterceptionsResponse>(url);
return response.data;
};

getAIBridgeModels = async (options: SearchParamOptions) => {
const url = getURLWithSearchParams("/api/v2/aibridge/models", options);

const response = await this.axios.get<string[]>(url);
return response.data;
};
}

export type TaskFeedbackRating = "good" | "okay" | "bad";
Expand All @@ -2760,26 +2777,6 @@ export type CreateTaskFeedbackRequest = {
// above the ApiMethods class for a full explanation.
class ExperimentalApiMethods {
constructor(protected readonly axios: AxiosInstance) {}

getAIBridgeInterceptions = async (options: SearchParamOptions) => {
const url = getURLWithSearchParams(
"/api/experimental/aibridge/interceptions",
options,
);
const response =
await this.axios.get<TypesGen.AIBridgeListInterceptionsResponse>(url);
return response.data;
};

getAIBridgeModels = async (options: SearchParamOptions) => {
const url = getURLWithSearchParams(
"/api/experimental/aibridge/models",
options,
);

const response = await this.axios.get<string[]>(url);
return response.data;
};
}

// This is a hard coded CSRF token/cookie pair for local development. In prod,
Expand Down
2 changes: 1 addition & 1 deletion site/src/api/queries/aiBridge.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const paginatedInterceptions = (
return ["aiBridgeInterceptions", payload, pageNumber] as const;
},
queryFn: ({ limit, offset, payload }) =>
API.experimental.getAIBridgeInterceptions({
API.getAIBridgeInterceptions({
offset,
limit,
q: payload,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export const useModelFilterMenu = ({
return useFilterMenu({
id: "model",
getSelectedOption: async () => {
const modelsRes = await API.experimental.getAIBridgeModels({
const modelsRes = await API.getAIBridgeModels({
q: value,
limit: 1,
});
Expand All @@ -33,7 +33,7 @@ export const useModelFilterMenu = ({
return null;
},
getOptions: async (query) => {
const modelsRes = await API.experimental.getAIBridgeModels({
const modelsRes = await API.getAIBridgeModels({
q: query,
limit: 25,
});
Expand Down
Loading