openai-java icon indicating copy to clipboard operation
openai-java copied to clipboard

Definitions is not supported

Open kusuri-h opened this issue 1 year ago • 2 comments

If definitions is used, the function token cannot be calculated successfully This is widely used in structured-outputs , you can see the document https://platform.openai.com/docs/guides/structured-outputs/definitions-are-supported

kusuri-h avatar Oct 18 '24 09:10 kusuri-h

Could you give me a example which is incorrect calculated?

forestwanglin avatar Oct 22 '24 05:10 forestwanglin

{ "messages": [{ "role": "system", "content": "## Task Descriptionment" }, { "role": "user", "content": "# Retrieved Knowledge" }], "stream": true, "temperature": 0.1, "tool_choice": { "type": "function", "function": { "name": "PartialNavigation1st" } }, "tools": [{ "type": "function", "function": { "name": "PartialNavigation1st", "description": "Correctly extracted PartialNavigation1st with all the required parameters with correct types", "parameters": { "$defs": { "PartialMultilingualProductType": { "properties": { "en": { "default": "English version of the suggested product type.", "title": "En", "type": "string" } }, "title": "PartialMultilingualProductType", "type": "object" } }, "name": "navigation_1st", "properties": { "decomposition": { "description": "Involves up to five extremely concise sentence of reasoning, covering requirement understanding, in-depth analysis, potential intention analysis, limited expansion e.g. alternatives for more specific scenarios, and reflection. Each should be concise but specific, reliable, and solid.Ensure conciseness. Avoid using scalar indices or bullet points. One sentence per rationale. Use specific language to narrate your rationales.", "items": { "type": "string" }, "maxItems": 5, "minItems": 0, "title": "Decomposition", "type": "array" }, "product_types": { "description": "Suggest around 10 diverse product types that meet the objective best. Each should be a complete search term, needing no modifiers to satisfy user needs, and must be semantically complete. Keep each within four words, focusing on product names or attributes like audience, functionality, size, or specificaitons, while avoiding brand names or model numbers. Use title Case. Cannot be null.", "items": { "$ref": "#/$defs/PartialMultilingualProductType" }, "maxItems": 15, "minItems": 0, "title": "Product Types", "type": "array" } }, "required": ["decomposition", "product_types"], "strict": true, "type": "object" } } }], "model": "gpt-4o" }

Such like this prompt

kusuri-h avatar Nov 05 '24 07:11 kusuri-h