Skip to content

Commit

Permalink
Load examples from config
Browse files Browse the repository at this point in the history
  • Loading branch information
akariv committed Feb 19, 2025
1 parent e2f658f commit 33f75b6
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
3 changes: 2 additions & 1 deletion odds/common/datatypes.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,4 +103,5 @@ class Deployment:
agentOrgName: str
agentCatalogDescriptions: str
uiLogoHtml: str
uiDisplayHtml: str
uiDisplayHtml: str
examples: List[str]
1 change: 1 addition & 0 deletions odds/common/deployment_repo/config_deployment_repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ async def load_deployments(self) -> list[Deployment]:
deployment['agent_catalog_descriptions'],
deployment['ui_logo_html'],
deployment['ui_display_html'],
deployment['examples']
)
for deployment in deployments
]
Expand Down
3 changes: 2 additions & 1 deletion ui/projects/ask/src/app/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ export type Deployment = {
agentOrgName: string,
agentCatalogDescriptions: string,
uiLogoHtml: string,
uiDisplayHtml: string
uiDisplayHtml: string,
examples: string[],
};

@Injectable({
Expand Down
16 changes: 9 additions & 7 deletions ui/projects/ask/src/app/home/home.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ <h2>&hellip;and we'll try to locate the answer in <span [innerHTML]='deployment?
</div>
} @else {
@if (!answer) {
<div class='examples'>
<h3>Not sure what to search for? Here are a few examples:</h3>
<div class='example-list'>
@for (example of EXAMPLES ; track example) {
<div class='example'>- &nbsp;"{{ example }}"</div>
}
@if (deployment?.examples) {
<div class='examples'>
<h3>Not sure what to search for? Here are a few examples:</h3>
<div class='example-list'>
@for (example of deployment?.examples ; track example) {
<div class='example'>- &nbsp;"{{ example }}"</div>
}
</div>
</div>
</div>
}
} @else {
<div class='answer' [innerHTML]='answer'></div>

Expand Down

0 comments on commit 33f75b6

Please sign in to comment.