MCPcopy Create free account
hub / github.com/Effect-TS/effect / getObjectName

Function getObjectName

packages/effect/src/unstable/ai/LanguageModel.ts:2208–2223  ·  view source on GitHub ↗
(
  objectName: string | undefined,
  schema: StructuredOutputSchema
)

Source from the content-addressed store, hash-verified

2206
2207/** @internal */
2208export 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
2225const resolveStructuredOutput = Effect.fnUntraced(function*<
2226 StructuredOutputSchema extends Schema.Constraint

Callers 1

generateObjectFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected