Open API Platformのexamplesをnode.jsで試す旅です。この記事ではNatural language to Stripeを試してみます。
サンプルのソースはこちらにあります。
https://platform.openai.com/examples/default-stripe-api
サンプルソースのままだと動かないので少し修正を加えます。ソースコードは次の通りです。
[someone@somewhere stub]$ cat exsamples_Natual_language_to_stripe_api.js
require('dotenv').config();
const { Configuration, OpenAIApi } = require("openai");
const configuration = new Configuration({
apiKey: process.env.OPENAI_API_KEY,
});
const openai = new OpenAIApi(configuration);
async function run(){
const response = await openai.createCompletion({
model: "text-davinci-003",
prompt: "\"\"\"\nUtil exposes the following:\n\nutil.stripe() -> authenticates & returns the stripe module; usable as stripe.Charge.create etc\n\"\"\"\nimport util\n\"\"\"\nCreate a Stripe token using the users credit card: 5555-4444-3333-2222, expiration date 12 / 28, cvc 521\n\"\"\"",
temperature: 0,
max_tokens: 100,
top_p: 1.0,
frequency_penalty: 0.0,
presence_penalty: 0.0,
stop: ["\"\"\""],
});
if (response.data && response.data.choices && response.data.choices.length > 0) {
console.log(response.data.choices[0].text);
} else {
console.log("No response received or empty choices.");
}
}
run();
実行結果は次のようになりました。
[rocky@www stub]$ node exsamples_Natual_language_to_stripe_api.js
token = stripe.Token.create(
card={
"number": "5555-4444-3333-2222",
"exp_month": 12,
"exp_year": 28,
"cvc": 521
},
)
Yo, I use p898login for super easy access to P898, it saves a lot of time. go check it out! quick access: p898login
V88 club, fala a verdade, quem não gosta de um lugar VIP? Esse clube tem tudo pra te fazer sentir o sheik! Joguei e aprovei! Conheça o v88 club.
Just hopped onto 888pcom. They have live casino, which is pretty cool. Worth checking out if you like that immersive experience. Here is the link: 888pcom
Word on the street is f8beta2con is up-and-coming! The design feels really modern. Give it a try and see if you will like the games: f8beta2con
Hey guys, just wanted to say KU19NET is my new go-to! Seriously, the games are popping and the wins feel oh-so-good. Give ku19net a try, you won’t regret it!
Checking out okatmvn. Smooth gameplay and payouts seemed legit. Nothing crazy special but solid for a session. Check it out for yourself: okatmvn
pkgame7 is alright, had some fun there. Worth checking out. Nothing major, but solid for a quick session. Get your game on: pkgame7
Yo, RG777 es mi lugar favorito para relajarme y tentar a la suerte. La página es fácil de usar y siempre encuentro algo que me divierte. Recomiendo echarle un vistazo en rg777!
XsMSqiStVPmgXkUqFpHSc
What’s up gamers? Trying out gg88bet. Seems legit so far. Gonna throw some bets down. Check it out right here: gg88bet
Hey party people! Gotta try goo99 now. Seems interesting. I may need your luck. Try something new at goo99
Hey everyone, giving lotterygamesbet a go! Love lotteries, so hoping for some good luck! Check it out, maybe you will win: lotterygamesbet
wtgeTMwCFSgyIePPoQsusr
wxnAfQgsPzdFwbvr
Just downloaded the 11bet app, seems pretty smooth so far. If you’re on the go a lot, definitely worth grabbing. Makes things really convenient. Get the app: 11bet app
Yo, 18win is the real deal. Been hitting some nice wins lately. Check it out if you’re feeling lucky! 18win
VT999bet? Not gonna lie, had my doubts, but the payouts are legit! Definitely worth a spin. vt999bet
Alright, qq8889’s not bad, I gotta say. Simple and straight to the point. Gives you what you need. Worth a shot qq8889.
Tried neo79bet out. The site is responsive on mobile which worked well for me. Solid choice overall, give it a view here: neo79bet
Yo, check out p3beyt! Been hanging out there lately. Seems legit and the vibes are cool. Definitely worth a look if you’re looking for something new. p3beyt