diff --git a/typescript/fiddle-frontend/app/[project_id]/_components/ExploreProjects.tsx b/typescript/fiddle-frontend/app/[project_id]/_components/ExploreProjects.tsx index a71562fd9..5bcc8dfff 100644 --- a/typescript/fiddle-frontend/app/[project_id]/_components/ExploreProjects.tsx +++ b/typescript/fiddle-frontend/app/[project_id]/_components/ExploreProjects.tsx @@ -6,39 +6,7 @@ import { type BamlProjectsGroupings, loadExampleProjects } from '@/lib/loadProje import { useEffect, useState } from 'react' export const ExploreProjects = () => { - const [projectGroups, setProjectGroups] = useState(null) - - useEffect(() => { - const fetchProjects = async () => { - const projects = await loadExampleProjects() - setProjectGroups(projects) - } - fetchProjects() - }, []) - - return ( -
- - Prompt Fiddle Examples - - Prompt Fiddle uses BAML -- a configuration language for LLM functions. Here are some example projects to get - you started. - - - -
- {projectGroups ? ( -
- - {/* */} - -
- ) : ( -
Loading...
- )} -
-
- ) + return null } const ExampleCarousel = ({ title, projects }: { title: string; projects: BAMLProject[] }) => { diff --git a/typescript/fiddle-frontend/app/layout.tsx b/typescript/fiddle-frontend/app/layout.tsx index 5484f77c7..2edba36df 100644 --- a/typescript/fiddle-frontend/app/layout.tsx +++ b/typescript/fiddle-frontend/app/layout.tsx @@ -35,9 +35,9 @@ export default function RootLayout({ Loading...}>{children} -
+ {/*
-
+
*/}
diff --git a/typescript/fiddle-frontend/app/not-found.tsx b/typescript/fiddle-frontend/app/not-found.tsx new file mode 100644 index 000000000..8e032a7b9 --- /dev/null +++ b/typescript/fiddle-frontend/app/not-found.tsx @@ -0,0 +1,11 @@ +import Link from 'next/link' + +export default function NotFound() { + return ( +
+

Not Found

+

Could not find requested resource

+ Return Home +
+ ) +} diff --git a/typescript/fiddle-frontend/lib/loadProject.ts b/typescript/fiddle-frontend/lib/loadProject.ts index 0ca81ecba..7111939f8 100644 --- a/typescript/fiddle-frontend/lib/loadProject.ts +++ b/typescript/fiddle-frontend/lib/loadProject.ts @@ -41,12 +41,10 @@ async function loadExampleProject( projectId: string, ): Promise { // Combine all projects into a single array - const exampleProjects = [ - ...groupings.intros, - ...groupings.advancedPromptSyntax, - ...groupings.promptEngineering, - ...groupings.allProjects, - ] + const exampleProjects = [...groupings.allProjects] + if (groupings.newProject) { + exampleProjects.push(groupings.newProject) + } // Search for the project by id const proj = exampleProjects.find((project) => project.id === projectId) @@ -99,9 +97,7 @@ const getProjectFiles = async (projectPath: string): Promise => { export type BamlProjectsGroupings = { allProjects: BAMLProject[] - intros: BAMLProject[] - advancedPromptSyntax: BAMLProject[] - promptEngineering: BAMLProject[] + newProject: BAMLProject } export async function loadExampleProjects(): Promise { @@ -115,60 +111,13 @@ export async function loadExampleProjects(): Promise { files: [], }, ], - intros: [ - { - id: 'new-project', - name: 'New Project', - description: 'New project', - filePath: '/new-project/', - files: [], - }, - { - id: 'extract-resume', - name: 'Introduction to BAML', - description: 'A simple LLM function extract a resume', - filePath: '/intro/extract-resume/', - files: [], - }, - { - id: 'classify-message', - name: 'ClassifyMessage', - description: 'Classify a message from a user', - filePath: '/intro/classify-message/', - files: [], - }, - { - id: 'chat-roles', - name: 'ChatRoles', - description: 'Use a sequence of system and user messages', - filePath: '/intro/chat-roles/', - files: [], - }, - // { - // id: 'images', - // name: 'Using Vision / Image APIs', - // description: 'Extract resume from image', - // filePath: '/intro/images/', - // files: [], - // }, - ], - advancedPromptSyntax: [], - promptEngineering: [ - { - id: 'chain-of-thought', - name: 'Chain of Thought', - description: 'Using chain of thought to improve results and reduce hallucinations', - filePath: '/prompt-engineering/chain-of-thought/', - files: [], - }, - { - id: 'symbol-tuning', - name: 'Symbol Tuning', - filePath: '/prompt-engineering/symbol-tuning/', - description: 'Use symbol tuning to remove biases on schema property names', - files: [], - }, - ], + newProject: { + id: 'new-project', + name: 'New Project', + description: 'New project', + filePath: '/new-project/', + files: [], + }, } return exampleProjects } diff --git a/typescript/fiddle-frontend/next.config.mjs b/typescript/fiddle-frontend/next.config.mjs index ca6585f8b..50f62d1e4 100644 --- a/typescript/fiddle-frontend/next.config.mjs +++ b/typescript/fiddle-frontend/next.config.mjs @@ -1,14 +1,6 @@ /** @type {import('next').NextConfig} */ const nextConfig = { transpilePackages: ['jotai-devtools', '@baml/playground-common', '@gloo-ai/baml-schema-wasm-web', '@baml/common'], - rewrites: async () => { - return [ - { - source: '/anthropic/:path*', - destination: 'https://api.anthropic.com/:path*', - }, - ] - }, webpack(config, { isServer, dev }) { config.experiments = { ...config.experiments, diff --git a/typescript/fiddle-frontend/pages/api/[...path].ts b/typescript/fiddle-frontend/pages/api/[...path].ts index 931f1b795..c148408ba 100644 --- a/typescript/fiddle-frontend/pages/api/[...path].ts +++ b/typescript/fiddle-frontend/pages/api/[...path].ts @@ -1,6 +1,5 @@ import httpProxy from 'http-proxy' import { NextApiRequest, NextApiResponse } from 'next' -import url from 'url' const API_URL = process.env.API_URL // The actual URL of your API