OpenAI ichangobva kuunza chinhu chine simba chinodaidzwa kuti Predicted Outputs , iyo yakapinda chinyararire muchiitiko pasina kutariswa kwakawanda kubva kune tekinoroji midhiya-kutarisa kunofanirwa kururamiswa. Ndakaona kuti vataura izvi paX muakaundi yavo yekuvandudza , asi haina kushambadza zvakanyanya. Ndakafunga kukwevera pfungwa pazviri nekuti chinhu chinotonhorera uye chinobatsira.
Predicted Outputs inoderedza zvakanyanya latency yemuenzaniso mhinduro, kunyanya kana yakawanda yekubuda ichizivikanwa nguva isati yasvika. Iyi ficha inonyanya kubatsira kune maapplication anosanganisira kuvandudza zvinyorwa zvemavara kana mafaera ekodhi ane zvidiki zvigadziriso.
Predicted Outputs inobvumira vanogadzira kuti vakurumidze mhinduro dzeAPI kubva kuChat Completions apo zvinotarisirwa kubuda zvakanyanya kufanofungidzira. Nekupa kufanotaura kwemhinduro inotarisirwa uchishandisa prediction
yeparameter muChat Completions, modhi inogona kuburitsa inodiwa inobuda zvakanyanya. Kushanda uku kuri kuwanikwa neazvino gpt-4o uye gpt-4o-mini modhi.
Paunenge uine mhinduro uko zvakawanda zvemukati zvave kutozivikanwa, unogona kupa izvo zvinotarisirwa zvirimo sekufanotaura kune modhi. Iyo modhi inozoshandisa fungidziro iyi kukurumidzira chizvarwa chemhinduro, kuderedza latency nekuvandudza mashandiro.
Fungidzira iwe une JSON yekumisikidza faira inoda diki yekuvandudza. Heino muenzaniso wefaira rakadaro:
{ "appName": "MyApp", "version": "1.0.0", "settings": { "enableFeatureX": false, "maxUsers": 100 } }
Ngatiti iwe unoda kugadzirisa "enableFeatureX"
kuti true
. Panzvimbo pekugadzira faira yose kubva pakutanga, unogona kupa faira yepakutanga sekufanotaura uye kuraira muenzaniso kuti uite shanduko inodiwa.
import OpenAI from "openai"; const config = ` { "appName": "MyApp", "version": "1.0.0", "settings": { "enableFeatureX": false, "maxUsers": 100 } } `.trim(); const openai = new OpenAI(); const updatePrompt = ` Change "enableFeatureX" to true in the following JSON configuration. Respond only with the updated JSON, without any additional text. `; const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [ { role: "user", content: updatePrompt }, { role: "user", content: config } ], prediction: { type: "content", content: config } }); // Output the updated configuration console.log(completion.choices[0].message.content);
Mumuenzaniso uyu, modhi yacho inokurumidza kuburitsa iyo yakagadziridzwa faira yekumisikidza, ichisimudzira fungidziro kuderedza nguva yekupindura.
Kune maapplication anoda kutenderera mhinduro, Predicted Outputs inopa yakanyanya kudzikisira latency. Heano maitiro aungaita muenzaniso wekare uchishandisa kutenderera:
import OpenAI from "openai"; const config = `...`; // Original JSON configuration const openai = new OpenAI(); const updatePrompt = `...`; // Prompt as before const completion = await openai.chat.completions.create({ model: "gpt-4o", messages: [ /* ... */ ], prediction: { type: "content", content: config }, stream: true }); for await (const chunk of completion) { process.stdout.write(chunk.choices[0]?.delta?.content || ""); }
Panguva yekunyora, hapana dzimwe nzira dzemhinduro iyi kubva kune vanokwikwidza. OpenAI's Predicted Outputs chimiro chinoratidzika sechipo chakasarudzika chinogadzirisa iyo chaiyo kudiwa kwekudzikisa latency kana uchigadzirazve zvinozivikanwa zvirimo nediki gadziriso.
Chinhu chinotonhorera ndechekuti kutanga kuishandisa, hapana chaunoda. Ingoitora uye uishandise nekuwedzera imwe chete itsva parameter kune API chikumbiro. Izvi zvinoita kuti zvive nyore kwazvo kune vanogadzira kuita iyi ficha mumashandisirwo avo aripo.
Nepo Zvakafanotaurwa Zvinobuda zvichipa zvakakosha zvakakosha, pane zvakakosha kufunga:
rejected_prediction_tokens
mune data rekushandisa kugadzirisa mitengo.n
(zvinokosha kupfuura 1)logprobs
presence_penalty
(values yakakura kupfuura 0)frequency_penalty
(nhamba dzinopfuura 0)max_completion_tokens
tools
(basa rekufona haritsigirwe)
OpenAI's Predicted Outputs chinhu chinokatyamadza chinogadzirisa dambudziko rakajairika mumashandisirwo eAI: kudzikisa latency kana mhinduro ichinyanya kufungidzira. Nekubvumidza vanogadzira kuti vape zvinotarisirwa zvinobuda, inomhanyisa nguva dzekupindura uye inosimudzira ruzivo rwemushandisi.
Mukufunga kwangu pachangu, OpenAI modhi haina kusimba senge Anthropic's modhi. Nekudaro, OpenAI inogadzira akawanda anotonhorera uye anodiwa mhinduro mune dzimwe nzvimbo. Zvimiro zvakaita sePredicted Outputs inoisa OpenAI parutivi kubva kune vamwe vanopa AI, ichipa yakasarudzika mhinduro inosangana nezvinodiwa chaizvo munharaunda yekuvandudza.