Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Add prompt editor to the Management Portal #2067

Merged
merged 1 commit into from
Dec 13, 2024
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
1 change: 1 addition & 0 deletions src/ui/ManagementPortal/components/Sidebar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
<li><NuxtLink to="/agents/create" class="sidebar__item">Create New Agent</NuxtLink></li>
<li><NuxtLink to="/agents/public" class="sidebar__item">All Agents</NuxtLink></li>
<li><NuxtLink to="/agents/private" class="sidebar__item">My Agents</NuxtLink></li>
<li><NuxtLink to="/prompts" class="sidebar__item">Agent Prompts</NuxtLink></li>
</ul>
<!-- <div class="sidebar__item">Performance</div> -->

Expand Down
19 changes: 19 additions & 0 deletions src/ui/ManagementPortal/js/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,25 @@ export default {
/*
Prompts
*/
async getPrompts(): Promise<ResourceProviderGetResult<Prompt>[] | null> {
try {
const data = await this.fetch(`/instances/${this.instanceId}/providers/FoundationaLLM.Prompt/prompts?api-version=${this.apiVersion}`);
return data as ResourceProviderGetResult<Prompt>[];
} catch (error) {
return null;
}
},

async getPromptByName(promptName: string): Promise<ResourceProviderGetResult<Prompt> | null> {
// Attempt to retrieve the prompt. If it doesn't exist, return an empty object.
try {
const data = await this.fetch(`/instances/${this.instanceId}/providers/FoundationaLLM.Prompt/prompts/${promptName}?api-version=${this.apiVersion}`);
return data[0];
} catch (error) {
return null;
}
},

async getPrompt(promptId: string): Promise<ResourceProviderGetResult<Prompt> | null> {
// Attempt to retrieve the prompt. If it doesn't exist, return an empty object.
try {
Expand Down
Loading
Loading