I’m using the GPT function call to extract some of the parameters I want, but it’s not working properly when I’m using array type with enum string.
My JSON schema looks like this:
parameters: {
type: "object",
properties: {
projects: {
type: "array",
description: "the project information list extracted from the mail text",
items: {
type: "object",
properties: {
category: {
type: "array",
items: {
type: "string",
enum: %w[WEB/オープン系アプリケーション 汎用系 ネイティブアプリ 制御、組込系 データベース ネットワーク サーバー セキュリティ 社内SE RPA SAP AI・機械学習 データアナリスト その他],
}
},
workspace: {
type: "array",
items: {
type: "string",
enum: %w[ITコンサル ITアーキテクト PM/PMO ウェブディレクター プロダクトマネージャー システム要件定義 システム基本設計 システム詳細設計 システム開発 システム運用、保守 バックエンド開発 フロントエンド開発 QA、テスト インフラ設計、構築 インフラ運用、保守 テクニカルサポート・ヘルプデスク データ収集、加工、分析 プリセールス・セールスエンジニア その他]
}
}
}
}
}
},
required: %w[projects]
}
Is there something wrong with the schema I wrote? Or does GPT not currently support that?
output:
JSON.parse(resp.dig("choices", 0, "message", "function_call", "arguments"))
"category"=>"制御、組込系",
"workspace"=>"システム要件定義",