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
8 changes: 8 additions & 0 deletions source/_static/js/getSwaggerJson.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ const devFetchUrls = {
authUrl: "https://dev.api.openprotein.ai/openapi.json",
embeddingsUrl:
"https://dev.api.openprotein.ai/api/v1/embeddings/swagger/doc.json",
promptUrl: "https://dev.api.openprotein.ai/api/v1/prompt/openapi.json",
};

const prodFetchUrls = {
Expand All @@ -192,6 +193,7 @@ const prodFetchUrls = {
authUrl: "https://api.openprotein.ai/openapi.json",
embeddingsUrl:
"https://api.openprotein.ai/api/v1/embeddings/swagger/doc.json",
promptUrl: "https://api.openprotein.ai/api/v1/prompt/openapi.json",
};

export default async function getSwaggerJson(swaggerType) {
Expand Down Expand Up @@ -236,6 +238,12 @@ export default async function getSwaggerJson(swaggerType) {
// get the full swagger specs
swagerSpecs = await (await fetch(fetchUrls.embeddingsUrl)).json();
return swagerSpecs;
} else if (swaggerType === "prompt") {
// The prompt service exports its own (prompt-only) spec, so there is
// nothing to filter — fetch and return it as-is. Includes the dynamic
// per-system-prompt routes whenever the backend DB is seeded.
swagerSpecs = await (await fetch(fetchUrls.promptUrl)).json();
return swagerSpecs;
}

const filteredPathsToShow = {};
Expand Down
Loading
Loading