<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>nowokay</author_name>
  <author_url>https://blog.hatena.ne.jp/nowokay/</author_url>
  <blog_title>きしだのHatena</blog_title>
  <blog_url>https://nowokay.hatenablog.com/</blog_url>
  <categories>
    <anon>AI</anon>
    <anon>java</anon>
  </categories>
  <description>昨日のエントリでは歌詞と画像を生成したのだけど、歌詞を生成する部分のプロンプトを変えて、エンジンにCodexを使うとコードを生成できます。 GPTを呼び出す部分はこんな感じ String prompt = &quot;//Java\n&quot; + text.getText().trim().lines() .map(&quot;// %s%n&quot;::formatted) .collect(Collectors.joining()); CompletionRequest completionRequest = CompletionRequest.builder() .model(&quot;code-davinci-002&quot;) //…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fnowokay.hatenablog.com%2Fentry%2F2023%2F02%2F01%2F100532&quot; title=&quot;GPTでテキストからJavaコードを生成する - きしだのHatena&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url>https://cdn-ak.f.st-hatena.com/images/fotolife/n/nowokay/20230201/20230201095333.png</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2023-02-01 10:05:32</published>
  <title>GPTでテキストからJavaコードを生成する</title>
  <type>rich</type>
  <url>https://nowokay.hatenablog.com/entry/2023/02/01/100532</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
