Skip to content

Commit

Permalink
added openAPI & ai-plug files, put frontend header back
Browse files Browse the repository at this point in the history
  • Loading branch information
MSFTJim committed Apr 14, 2024
1 parent 45c5d37 commit daeb75d
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 4 deletions.
17 changes: 17 additions & 0 deletions TSA-API/tsaWaitTime/.well-known/ai-plugin.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"schema_version": "v1",
"name_for_model": "TSA Wait times",
"name_for_human": "TSA Wait times",
"description_for_model": "Plugin to fetch TSA wait times for NYNJ Port Authority. Pass a 3 letter airport code to recieve the wait times for that airport",
"description_for_human": "Plugin to fetch TSA wait times for NYNJ Port Authority",
"auth": {
"type": "none"
},
"api": {
"type": "openapi",
"url": "http://localhost:5088/swagger/v1/swagger.json"
},
"logo_url": "http://localhost:5088/.well-known/tsalogo.png",
"contact_email": "[email protected]",
"legal_info_url": "http://www.example.com/legal"
}
Binary file added TSA-API/tsaWaitTime/.well-known/tsalogo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
29 changes: 29 additions & 0 deletions TSA-API/tsaWaitTime/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,35 @@

}).WithOpenApi();

app.MapGet("/.well-known/ai-plugin.json", () =>
{
var mimeType = "application/json"; // Set the appropriate MIME type for your file
var path = @".well-known/ai-plugin.json"; // Specify the path to your file

var pluginFile = File.ReadAllText(path);
return pluginFile;
//return Results.File(path, contentType: mimeType);

// if (File.Exists(path))
// {
// //return "The file does exist.";
// return Results.File(path, contentType: mimeType);
// }
// else
// {
// return "The file does not exist.";
// }
//return "Hello Well Known";
//TSA-API/tsaWaitTime/.well-known/ai-plugin.json

}).WithOpenApi();


app.MapGet("/hello", () => { return "Hello, World!"; });




app.Run();


Expand Down
6 changes: 6 additions & 0 deletions TSA-API/tsaWaitTime/tsaWaitTime.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,10 @@
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.5.0" />
</ItemGroup>

<ItemGroup>
<Content Include=".well-known\*.*">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>

</Project>
8 changes: 4 additions & 4 deletions webapp/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import { FluentProvider, Subtitle1, makeStyles, shorthands, tokens } from '@flue

import * as React from 'react';
import { useEffect } from 'react';
// import { UserSettingsMenu } from './components/header/UserSettingsMenu';
// import { PluginGallery } from './components/open-api-plugins/PluginGallery';
import { UserSettingsMenu } from './components/header/UserSettingsMenu';
import { PluginGallery } from './components/open-api-plugins/PluginGallery';
import { BackendProbe, ChatView, Error, Loading, Login } from './components/views';
import { AuthHelper } from './libs/auth/AuthHelper';
import { useChat, useFile } from './libs/hooks';
Expand Down Expand Up @@ -179,7 +179,7 @@ const Chat = ({
<div className={classes.container}>
<div className={classes.header}>
<Subtitle1 as="h1">Airport Agent</Subtitle1>
{/* {appState > AppState.SettingUserInfo && (
{appState > AppState.SettingUserInfo && (
<div className={classes.cornerItems}>
<div className={classes.cornerItems}>
<PluginGallery />
Expand All @@ -190,7 +190,7 @@ const Chat = ({
/>
</div>
</div>
)} */}
)}
</div>
{appState === AppState.ProbeForBackend && <BackendProbe onBackendFound={onBackendFound} />}
{appState === AppState.SettingUserInfo && (
Expand Down

0 comments on commit daeb75d

Please sign in to comment.