| 2206 | |
| 2207 | /** @internal */ |
| 2208 | export const getObjectName = <StructuredOutputSchema extends Schema.Constraint>( |
| 2209 | objectName: string | undefined, |
| 2210 | schema: StructuredOutputSchema |
| 2211 | ): string => { |
| 2212 | if (Predicate.isNotUndefined(objectName)) { |
| 2213 | return objectName |
| 2214 | } |
| 2215 | if ("identifier" in schema && typeof schema.identifier === "string") { |
| 2216 | return schema.identifier |
| 2217 | } |
| 2218 | const identifier = SchemaAST.resolveIdentifier(schema.ast) |
| 2219 | if (typeof identifier === "string") { |
| 2220 | return identifier |
| 2221 | } |
| 2222 | return "generateObject" |
| 2223 | } |
| 2224 | |
| 2225 | const resolveStructuredOutput = Effect.fnUntraced(function*< |
| 2226 | StructuredOutputSchema extends Schema.Constraint |