ზოგიერთი კვირის წინ, OpenAI აწარმოებს Apps for ChatGPT. როგორც თქვენ შეგიძლიათ იხილოთ ქვემოთ, ეს საშუალებას გაძლევთ ბიზნესებს მათი პროდუქტის პირდაპირი ჩატი, რათა დაეხმაროს მომხმარებლის მოთხოვნა. აპლიკაცია შეიძლება გააქტიურდეს ან გამოხატული შეტყობინება, ან როდესაც მოდელი აირჩიებს, რომ აპლიკაცია იქნება სასარგებლო. So, what is a ChatGPT App? მომხმარებლისთვის, ეს არის გზა, რათა მიიღოთ უფრო მდიდარი მომხმარებლის გამოცდილება და ფუნქციონირება, უფრო მეტია, ვიდრე ტექსტალური ინტერფეისი. ბიზნესისთვის, ეს არის გზა, რათა მიაღწიოს მეტი 800 მილიონი ChatGPT მომხმარებელს სწორი დროში. განვითარებისთვის, ეს არის MCP სერვერები და ვებ პროგრამა, რომელიც მუშაობს iframe <= ეს არის ის, რაც ჩვენ აქ ვთქვათ! Demo ამ პოსტში, მე მივიღებთ შექმნის მარტივი კლიენტების პროგრამა, რომელიც იხილება ქვემოთ, გამოიყენოთ იგი მაგალითად, რათა აჩვენოთ ხელმისაწვდომი ფუნქციები. მნიშვნელოვანი შენიშვნა: თუ გსურთ დაიცვას, თქვენ უნდა გაქვთ გადახდის ChatGPT რეგისტრაცია, რათა გააქტიუროთ Developer Mode. სტანდარტული $ 20 / თვის მომხმარებლის რეგისტრაცია იქნება საკმარისი. თუ გსურთ გაგზავნას, სტანდარტული $ 20 / თვე კლიენტების რეგისტრაცია საკმარისი იქნება. Important Note: you will need a paid ChatGPT subscription to enable Developer Mode მაღალი ხარისხის Flow აქ არის, თუ როგორ მუშაობს მაღალი დონეზე (ფუნქციური ნაბიჯები შეიძლება განსხვავდეს პატარა): პირველი, აპლიკაციის განვითარებელი ჩაწერებს იგი ChatGPT- ში ეს აწარმოებს app დასაწყისი და ეს საშუალებას გაძლევთ მოდელები, როგორიცაა ChatGPT, შეისწავლოთ და ინტეგრირებთ სხვა მომსახურებს. ჩვენი MCP სერვერზე იქნება " » და » ” უნდა შექმნათ ChatGPT Quiz app. ამ ნაბიჯზე, providing a link to the MCP server (1) MCP Model Context Protocol tools resources ChatGPT learns and remembers what our app does and when it can be useful. როდესაც პროგრამა უკვე არსებობს და მომხმარებლის მიმოხილვა როგორიცაა “ბეჭდვა სმ Altman”, ChatGPT შეამოწმებს, თუ არსებობს აპლიკაცია, რომელიც შეიძლება გამოყენებულ იქნას ტექსტური პასუხისგან, რათა უზრუნველყოს უკეთესი გამოცდილება მომხმარებელს . (2) (3) თუ აპლიკაცია იპოვება, ChatGPT იხილებს აპლიკაციის საჭირო მონაცემების დიზაინი ჩვენი პროგრამა უნდა მიიღოს მონაცემები შემდეგი JSON ფორმატში: (4) { questions: [ { question: "Where was Sam Altman born", options: ["San Francisco", ...], correctIndex: 2, ... }, ... ] } ეს მოუწოდა , და გაგზავნა ჩვენი app . ChatGPT will generate quiz data exactly in this format toolInput (5) App- ის გაკეთება და აწარმოებს ChatGPT აწარმოებს HTML "მართობი", რომელიც უზრუნველყოფს პროგრამა ჩატი ფანჯარაში, და დაინახებს იგი მონაცემები და ბოლოს, მომხმარებლის ნახავთ app და შეუძლიათ ინტერაქტიურება მას. . toolInput toolOutput toolOutput (6) (7) MCP სერვერის შექმნა Code repo ჩვენი ChatGPT app: . https://github.com/renal128/quizaurus-tutorial არსებობს 2 პროექტები: და პირველ რიგში, ჩვენ ვფიქრობ, რომ რომელიც იყენებს ჩვეულებრივი JavaScript frontend- ში, რათა რამე მარტივი. quizaurus-plain quizaurus-react quizaurus-plain ყველა სერვერზე კოდი არის ამ ფაილი - მხოლოდ დაახლოებით 140 ხაზი კოდი! https://github.com/renal128/quizaurus-tutorial/blob/main/quizaurus-plain/src/server.ts სერვერები არსებობს ბევრი ვარიანტი, რათა შექმნათ MCP სერვერზე გამოყენებით ნებისმიერი SDK- ს აქ: https://modelcontextprotocol.io/docs/sdk აქ, ჩვენ ვიყენებთ . სტატისტიკა MCP SDK შემდეგი კოდი აჩვენებს, თუ როგორ უნდა დააყენოთ: // Create an MCP server const mcpServer = new McpServer({ name: 'quizaurus-server', version: '0.0.1' }); // Add the tool that receives and validates questions, and starts a quiz mcpServer.registerTool( ... ); // Add a resource that contains the frontend code for rendering the widget mcpServer.registerResource( ... ); // Create an Express app const expressApp = express(); expressApp.use(express.json()); // Set up /mcp endpoint that will be handled by the MCP server expressApp.post('/mcp', async (req, res) => { const transport = new StreamableHTTPServerTransport({ sessionIdGenerator: undefined, enableJsonResponse: true }); res.on('close', () => { transport.close(); }); await mcpServer.connect(transport); await transport.handleRequest(req, res, req.body); }); const port = parseInt(process.env.PORT || '8000'); // Start the Express app expressApp.listen(port, () => { console.log(`MCP Server running on http://localhost:${port}/mcp`); }).on('error', error => { console.error('Server error:', error); process.exit(1); }); ძირითადი სიტყვები: Express app არის გენერალური სერვერზე, რომელიც მიიღებს კომუნიკაციის (მაგ. HTTP მოთხოვნები) გარეგან (შვეობით ChatGPT) გამოყენებით Express, ჩვენ დაამატოთ /mcp Endpoint რომ ჩვენ გთავაზობთ ChatGPT როგორც მისამართი ჩვენი MCP სერვერზე (გალითად, https://mysite.com/mcp) The handling of the endpoint is delegated to the MCP server, that runs within the Express app /mcp all of the MCP protocol that we need is handled within that endpoint by the MCP server mcpServer.registerTool(...) და mcpServer.registerResource(...) არის ის, რაც ჩვენ გამოიყენებთ ჩვენი Quiz პროგრამა MCP ინსტრუმენტები და შეავსეთ სიზუსტით placeholder above to register the “tool”. mcpServer.registerTool(…) ChatGPT წაიკითხებს ინსტრუმენტი განახლება, როდესაც ჩვენ დარეგისტრირებთ app, და შემდეგ, როდესაც მომხმარებლის საჭიროა, ChatGPT მოვუწოდებს ინსტრუმენტი დაიწყოს გამოცდილება: // Add the tool that receives and validates questions, and starts a quiz mcpServer.registerTool( 'render-quiz', { title: 'Render Quiz', description: ` Use this when the user requests an interactive quiz. The tool expects to receive high-quality single-answer questions that match the schema in input/structuredContent: each item needs { question, options[], correctIndex, explanation }. Use 5–10 questions unless the user requests a specific number of questions. The questions will be shown to the user by the tool as an interactive quiz. Do not print the questions or answers in chat when you use this tool. Do not provide any sensitive or personal user information to this tool.`, _meta: { "openai/outputTemplate": "ui://widget/interactive-quiz.html", // <- hook to the resource }, inputSchema: { topic: z.string().describe("Quiz topic (e.g., 'US history')."), difficulty: z.enum(["easy", "medium", "hard"]).default("medium"), questions: z.array( z.object({ question: z.string(), options: z.array(z.string()).min(4).max(4), correctIndex: z.number().int(), explanation: z.string().optional(), }) ).min(1).max(40), }, }, async (toolInput) => { const { topic, difficulty, questions } = toolInput; // Here you can run any server-side logic to process the input from ChatGPT and // prepare toolOutput that would be fed into the frontend widget code. // E.g. you can receive search filters and return matching items. return { // Optional narration beneath the component content: [{ type: "text", text: `Starting a ${difficulty} quiz on ${topic}.` }], // `structuredContent` will be available as `toolOutput` in the frontend widget code structuredContent: { topic, difficulty, questions, }, // Private to the component; not visible to the model _meta: { "openai/locale": "en" }, }; } ); კოდი უმაღლესი ნახევარი უზრუნველყოფს ინსტრუმენტის აღწერა - ChatGPT დაეხმარება, რომ იცოდეთ, როდესაც და როგორ უნდა გამოიყენოთ იგი: აღწერა დეტალურად აცხადებს, რა არის ინსტრუმენტი. ChatGPT გამოიყენებს ეს, რათა გადაწყვიტოს, თუ ინსტრუმენტი გამოიყენება მომხმარებლის რეპუტაცია. InputSchema არის გზა, რომ გითხრათ ChatGPT სწრაფად, რა მონაცემები მას უნდა უზრუნველყოს ინსტრუმენტი და როგორ უნდა სტრუქტურა. როგორც ხედავთ ზედაპირზე, მას შეიცავს რჩევები და შეზღუდვები, რომ ChatGPT შეიძლება გამოიყენოთ, რათა შექმნათ სწორი ხელმისაწვდომი სიჩქარე (toolInput). outputSchema აქ არ არის მოცემული, მაგრამ თქვენ შეგიძლიათ გაძლევთ ChatGPT- ს გითხრათ, რა schema structuredContent იქნება. ასე რომ, გარკვეული გზა, ინსტრუმენტი არის ის, რაც განმარტებს ChatGPT App აქ. იხილეთ სხვა 2 ფართობი აქ: _meta[“openai/outputTemplate”] არის MCP რესურსის ნომერი, რომელიც ChatGPT აპლიკაცია გამოიყენებს ვიჯეტის rendering- ისთვის. ჩვენ ვხედავ შემდეგი ნაწილში ქვემოთ. async (toolInput) => { ... არის ფუნქცია, რომელიც მიიღებს toolInput from ChatGPT და აწარმოებს toolOutput, რომელიც იქნება ხელმისაწვდომია ვიჯეტის. ეს არის სადაც ჩვენ შეგვიძლია გააქტიუროთ ნებისმიერი სერვერზე მხარეს ლოგიკა მონაცემების დამუშავება. ჩვენი შემთხვევაში, ჩვენ არ გჭირდებათ ნებისმიერი დამუშავება, რადგან toolInput უკვე შეიცავს ყველა ინფორმაციას, რომ ვიჯეტის საჭიროა, ასე რომ ფუნქცია მოგცემს იგივე მონაცემები structuredContent რომელიც იქნება ხელმისაწვდომია როგორც toolOutput ვიჯეტის. MCP რესურსები ქვემოთ არის, თუ როგორ ჩვენ განმარტობთ MCP რესურსის: // Add an MCP resource that contains frontend code for rendering the widget mcpServer.registerResource( 'interactive-quiz', "ui://widget/interactive-quiz.html", // must match `openai/outputTemplate` in the tool definition above {}, async (uri) => { // copy frontend script and css const quizaurusJs = await fs.readFile("./src/dist/QuizaurusWidget.js", "utf8"); const quizaurusCss = await fs.readFile("./src/dist/QuizaurusWidget.css", "utf8"); return { contents: [ { uri: uri.href, mimeType: "text/html+skybridge", // Below is the HTML code for the widget. // It defines a root div and injects our custom script from src/dist/QuizaurusWidget.js, // which finds the root div by its ID and renders the widget components in it. text: ` <div id="quizaurus-root" class="quizaurus-root"></div> <script type="module"> ${quizaurusJs} </script> <style> ${quizaurusCss} </style>` } ] } } ); ძირითადად, “მართობი” აქ უზრუნველყოფს პარტნიორული (ვუჯჯეტის) ნაწილი App. ui://widget/interactive-quiz.html არის რესურსის ID, და იგი უნდა შეესაბამება _meta[“openai/outputTemplate”] ინსტრუმენტი განახლება წინა ნაწილში ზედაპირზე. provides HTML code of the widget contents the HTML here is very simple - we just define the root div and add that will find that root div by ID, create necessary elements (buttons, etc) and define the quiz app logic. We will look at the script in the next section below. quiz-app-root the custom script Widget შექმნა Widget განახლება Now, let’s take a quick look at რომელიც განახლავს ვიჯეტის (მცველი ნაწილს პროგრამა): QuizaurusWidget.js პროგრამული უზრუნველყოფა // Find the root div defined by the MCP resource const root = document.querySelector('#quiz-app-root'); // create HTML elements inside the root div ... // try to initialize for widgetState to restore the quiz state in case the chat page gets reloaded const selectedAnswers = window.openai.widgetState?.selectedAnswers ?? {}; let currentQuestionIndex = window.openai.widgetState?.currentQuestionIndex ?? 0; function refreshUI() { // Read questions from window.openai.toolOutput - this is the output of the tool defined in server.ts const questions = window.openai.toolOutput?.questions; // Initially the widget will be rendered with empty toolOutput. // It will be populated when ChatGPT receives toolOutput from our tool. if (!questions) { console.log("Questions have not yet been provided. Try again in a few sec.") return; } // Update UI according to the current state ... }; // when an answer button is clicked, we update the state and call refreshUI() optionButtons.forEach((b) => { b.onclick = (event) => { const selectedOption = event.target.textContent selectedAnswers[currentQuestionIndex] = selectedOption; // save and expose selected answers to ChatGPT window.openai.setWidgetState({ selectedAnswers, currentQuestionIndex }); refreshUI(); }; }); ... // at the end of the quiz, the user can click this button to review the answers with ChatGPT reviewResultsButton.onclick = () => { // send a prompt to ChatGPT, it will respond in the chat window.openai.sendFollowUpMessage({ prompt: "Review my answers and explain mistakes" }); reviewResultsButton.disabled = true; }; startQuizButton.onclick = refreshUI; refreshUI(); ამ კოდი დაიწყება HTML- ის მიერ, რომელიც ჩვენ შეზღუდული MCP რესურსის ზედაპირზე (the HTML და სკრიპტი იქნება iframe- ში ChatGPT ჩატი გვერდზე. <script type="module">… ChatGPT აჩვენებს ზოგიერთი მონაცემები და hooks მეშვეობით Global object. აქ არის ის, რაც ჩვენ იყენებთ აქ: window.openai დასაწყისში, html იქნება rendered, სანამ ინსტრუმენტი returns toolOutput, ასე რომ window.openai.toolOutput იქნება თეთრი. ეს არის პატარა რთული, მაგრამ ჩვენ გადაიხადოს მას შემდეგ React. window.openai.widgetState და window.openai.setWidgetState() საშუალებას გაძლევთ გაუმჯობესოთ და ხელმისაწვდომია widget სტატისტიკა. ეს შეიძლება იყოს ნებისმიერი მონაცემები, რომ ჩვენ გსურთ, მიუხედავად იმისა, რომ რეკომენდაციას არის შენარჩუნება ქვემოთ 4000 tokens. აქ, ჩვენ გამოიყენებთ იგი, რათა აღიაროთ, რა კითხვები უკვე პასუხს მომხმარებლის მიერ, ასე რომ, თუ გვერდზე დააყენებს, widget აღიარებს სტატისტიკა. is a way to give a prompt to ChatGPT as if the user wrote it, and ChatGPT will write the response in the chat. window.openai.sendFollowUpMessage({prompt: “…”}) თქვენ შეგიძლიათ იპოვოთ მეტი შესაძლებლობები OpenAI დოკუმენტაცია აქ: https://developers.openai.com/apps-sdk/build/custom-ux შევიდა ყველაფერი ერთად ახლა არის დრო, რომ ტესტირება! სწრაფი მიმოხილვა, თქვენ უნდა გაქვთ გადახდის ChatGPT რეგისტრაცია, რათა გააქტიუროთ Developer Mode. Clone this repo [Download the code] https://github.com/renal128/quizaurus-tutorial There are 2 projects in this repo, a minimalistic one, described above, and a slicker-looking React one. We’ll focus on the first one for now. Open a terminal, navigate to the repo directory and run the following commands: [Starting the server] cd quizaurus-plain install NodeJS if you don’t have it https://nodejs.org/en/download/ to install dependencies defined in package.json npm install to start the Express app with MCP server - npm start keep it running [ ] Expose your local server to the web Create a free ngrok account: https://ngrok.com/ Open a (the other one with the Express app should keep running separately) new terminal Install ngrok: https://ngrok.com/docs/getting-started#1-install-the-ngrok-agent-cli on MacOS brew install ngrok Connect ngrok on your laptop to your ngrok account by configuring it with your auth token: https://ngrok.com/docs/getting-started#2-connect-your-account Start ngrok: ngrok http 8000 You should see something like this in the bottom of the output: Forwarding: https://xxxxx-xxxxxxx-xxxxxxxxx.ngrok-free ngrok created a tunnel from your laptop to a public server, so that your local server is available to everyone on the internet, including ChatGPT. Again, , don’t close the terminal keep it running - this is the part that r , $20/month, otherwise you may not see developer mode available. [Enable Developer Mode on ChatGPT] equires a paid customer subscription Go to ChatGPT website => Settings => Apps & Connectors => Advanced settings Enable the “Developer mode” toggle [Add the app] Go back to “Apps & Connectors” and click “Create” in the top-right corner Fill in the details as on the screenshot. For “MCP Server URL” use the URL that ngrok gave you in the terminal output and . add /mcp to it at the end Click on your newly added app You should see the MCP tool under Actions - now ChatGPT knows when and how to use the app. When you make changes to the code, sometimes , otherwise it can remain cached (sometimes I even delete and re-add the app due to avoid caching). you need to click Refresh to make ChatGPT pick up the changes [ ] Finally, we’re ready to test it! Test the app In the chat window you can nudge ChatGPT to use your app by selecting it under the “ ” button. In my experience, it’s not always necessary, but let’s do it anyway. Then try a prompt like “Make an interactive 3-question quiz about Sam Altman”. + You should see ChatGPT asking your approval to call the MCP tool with the displayed . I assume that it’s a feature for unapproved apps, and it won’t happen once the app is properly reviewed by OpenAI (although, as of Nov 2025 there’s no defined process to publish an app yet). So, just click “Confirm” and wait a few seconds. toolInput As I mentioned above, the widget gets rendered before is returned by our MCP server. This means that if you click “Start Quiz” too soon, it won’t do anything - try again a couple seconds later. (we will fix that with React in the next section below). When the data is ready, clicking “Start Quiz” should show the quiz! toolOutput React გამოყენება ზედაპირზე, ჩვენ ვხედავ კოდი, რომელიც იყენებს ჩვეულებრივი JavaScript. სხვა პროექტი იგივე repo, , აჩვენებს, თუ როგორ გამოიყენოთ ChatGPT განაცხადის გამოყენებით React. Quizaurus რეაქტი თქვენ შეგიძლიათ ნახოთ ზოგიერთი სასარგებლო დოკუმენტაცია OpenAI აქ: . https://developers.openai.com/apps-sdk/build/custom-ux/ OpenAiGlobal Helper ჰოქები თქვენ შეგიძლიათ იხილოთ მათ აქ, კოდი კუპირებულია დოკუმენტაციადან: https://github.com/renal128/quizaurus-tutorial/blob/main/quizaurus-react/web/src/openAiHooks.ts ყველაზე სასარგებლო არის , რომელიც საშუალებას გაძლევთ React აპლიკაცია განახლებებისათვის გაითვალისწინეთ, რომ ზედაპირზე ჩვეულებრივ (non-React) პროგრამაში, პრობლემა იყო, რომ “Start Quiz” ღილაკს არაფერი არ გააკეთა, სანამ მონაცემები მზად იყო? ახლა ჩვენ შეგვიძლია UX- ის გაუმჯობესებას აჩვენოს დატვირთვის ანამატურა: useToolOutput window.openai.toolOutput function App() { const toolOutput = useToolOutput() as QuizData | null; if (!toolOutput) { return ( <div className="quiz-container"> <p className="quiz-loading__text">Generating your quiz...</p> </div> ); } // otherwise render the quiz ... } როდესაც ToolOutput პოპულარულია, React ავტომატურად აწარმოებს პროგრამა და აჩვენებს კითხვებს დატვირთვის სტატისტიკა. Router რეაქტი სტრატეგიის ისტორია iframe, სადაც app არის rendered, დაკავშირებულია სტრატეგიის ისტორია გვერდზე, ასე რომ თქვენ შეგიძლიათ გამოიყენოთ routing APIs, როგორიცაა React Router განახლება ნავიგაცია app. სხვა Quirks და თვისებები შენიშვნა: ChatGPT აპლიკაციის განვითარება ამჟამად არ არის ძალიან სტაბილური, რადგან ფუნქცია არ არის სრულიად გააქტიურებული, ასე რომ საკმარისი არის, რომ მოითხოვოთ API- ს ან მცირე bugs. გთხოვთ დააყენოთ ოფიციალური დოკუმენტაცია უახლესი განახლებებისთვის: https://developers.openai.com/apps-sdk როგორ და როდესაც ChatGPT აირჩიოს თქვენი პროგრამა მომხმარებელს The most important part is that your app’s metadata, such as the tool description, must feel relevant to the conversation. ChatGPT’s goal here is to provide the best UX to the user, so obviously if the app’s description is irrelevant to the prompt, the app won’t be shown. I’ve also seen ChatGPT asking the user to rate if the app was helpful or not, I suppose this feedback is also taken into account. App Metadata. Official recommendations: https://developers.openai.com/apps-sdk/guides/optimize-metadata The in order to be used. How would the user know to link an app? There are 2 ways: App Discovery. app needs to be linked/connected to the user’s account Manual - go to and find the app there. Settings => Apps & Connectors Contextual Suggestion - if the app is not connected, but is highly relevant in the conversation, ChatGPT may offer to connect it. I wasn’t able to make it work with my app, but I saw it working with pre-integrated apps like Zillow or Spotify: განკუთვნილია, თუ როგორ უნდა გააკეთოთ ეს, თუ როგორ უნდა გააკეთოთ ეს, თუ როგორ უნდა გააკეთოთ ეს, თუ როგორ უნდა გააკეთოთ ეს. მხარდაჭერა პლატფორმა Web - იმის გამო, რომ ეს განახლება iframe, web არის ყველაზე მარტივი პლატფორმა მხარდაჭერა და მე თითქმის არ იყო პრობლემები. მობილური აპლიკაცია - თუ თქვენ კავშირდით აპლიკაცია ინტერნეტში, თქვენ უნდა, შეუძლიათ ნახოთ იგი მობილური. მე არ შეგვიძლია დაიწყოს აპლიკაცია მობილური - ეს არ ეხლა ინსტრუმენტი, მაგრამ როდესაც მე დაიწყე აპლიკაცია ინტერნეტში, მე შეგვიძლია კონტაქტი მას მობილური. შეიძლება იყოს დროული bug. ავტომატური ChatGPT Apps მხარს უჭერს OAuth 2.1: https://developers.openai.com/apps-sdk/build/auth ეს არის დიდი თემა, გთხოვთ გაიგოთ, თუ სასარგებლო იქნება პირდაპირი პოსტი ამ შესახებ! ქსელის მოთხოვნები ეს არის ის, რაც დოკუმენტები ამბობენ ( » » » მუშაობა თქვენი OpenAI პარტნიორთან, თუ თქვენ გჭირდებათ კონკრეტული დონეები საშუალებას სიაში. " წყარო Standard fetch requests are allowed only when they comply with the CSP სხვა ადგილებში ( ), ეს გთავაზობთ configuring სავარაუდოდ, იმ შემთხვევაში, თუ თქვენ გაქვთ სავარაუდოდ სავარაუდოდ სავარაუდოდ სავარაუდოდ სავარაუდოდ: აქ _meta _meta: { ... /* Assigns a subdomain for the HTML. When set, the HTML is rendered within `chatgpt-com.web-sandbox.oaiusercontent.com` It's also used to configure the base url for external links. */ "openai/widgetDomain": 'https://chatgpt.com', /* Required to make external network requests from the HTML code. Also used to validate `openai.openExternal()` requests. */ 'openai/widgetCSP': { // Maps to `connect-src` rule in the iframe CSP connect_domains: ['https://chatgpt.com'], // Maps to style-src, style-src-elem, img-src, font-src, media-src etc. in the iframe CSP resource_domains: ['https://*.oaistatic.com'], } } კიდევ ერთი რამ, რაც შეგიძლიათ გამოიყენოთ, არის თქვენი app widget (frontend) შეუძლია გამოიყენოს იგი დააჭირეთ ინსტრუმენტი თქვენი MCP სერვერზე - თქვენ უზრუნველყოფს MCP ინსტრუმენტი სახელი და ინსტრუმენტიInput მონაცემები და მიიღეთ back toolOutput: window.openai.callTool await window.openai?.callTool("my_tool_name", { "param_name": "param_value" }); სხვა frontend ფუნქციები იხილეთ ეს დოკუმენტაცია, რაც ხელმისაწვდომია თქვენი frontend კოდი მიერ : : : window.openai https://developers.openai.com/apps-sdk/build/custom-ux თქვენ შეგიძლიათ მიიღოთ შემდეგი ფართობი (გ.შ. თქვენ გაიგებთ, თუ ChatGPT არის ამჟამად სინათლის ან შავი რეჟიმში): window.openai.theme theme: Theme; userAgent: UserAgent; locale: string; // layout maxHeight: number; displayMode: DisplayMode; safeArea: SafeArea; // state toolInput: ToolInput; toolOutput: ToolOutput | null; toolResponseMetadata: ToolResponseMetadata | null; widgetState: WidgetState | null; Similarly, თქვენ შეგიძლიათ გამოიყენოთ შემდეგი callbacks (გალითად, ცდილობენ გააკეთოთ თქვენი app სრული ეკრანზე): await window.openai?.requestDisplayMode({ mode: "fullscreen" }); /** Calls a tool on your MCP. Returns the full response. */ callTool: ( name: string, args: Record<string, unknown> ) => Promise<CallToolResponse>; /** Triggers a followup turn in the ChatGPT conversation */ sendFollowUpMessage: (args: { prompt: string }) => Promise<void>; /** Opens an external link, redirects web page or mobile app */ openExternal(payload: { href: string }): void; /** For transitioning an app from inline to fullscreen or pip */ requestDisplayMode: (args: { mode: DisplayMode }) => Promise<{ /** * The granted display mode. The host may reject the request. * For mobile, PiP is always coerced to fullscreen. */ mode: DisplayMode; }>; /** Update widget state */ setWidgetState: (state: WidgetState) => Promise<void>; მადლობა ! ეს არის ყველა, მადლობა წაიკითხვისთვის და საუკეთესო წარმატება რა თქმა უნდა, რაც თქვენ აშენებთ!