MCPcopy Index your code
hub / github.com/anomalyco/opencode / generateObject

Function generateObject

packages/llm/src/llm.ts:164–186  ·  view source on GitHub ↗
(options: GenerateObjectOptions<ToolSchema<any>> | GenerateObjectDynamicOptions)

Source from the content-addressed store, hash-verified

162 options: GenerateObjectDynamicOptions,
163): Effect.Effect<GenerateObjectResponse<unknown>, LLMError>
164export function generateObject(options: GenerateObjectOptions<ToolSchema<any>> | GenerateObjectDynamicOptions) {
165 if ("schema" in options) {
166 const { schema, ...rest } = options
167 return runGenerateObject(
168 rest,
169 makeTool({
170 description: GENERATE_OBJECT_TOOL_DESCRIPTION,
171 parameters: schema,
172 success: Schema.Unknown as ToolSchema<unknown>,
173 execute: () => Effect.void,
174 }),
175 )
176 }
177 const { jsonSchema, ...rest } = options
178 return runGenerateObject(
179 rest,
180 makeTool({
181 description: GENERATE_OBJECT_TOOL_DESCRIPTION,
182 jsonSchema,
183 execute: () => Effect.void,
184 }),
185 )
186}

Callers 1

agent.tsFile · 0.85

Calls 1

makeToolFunction · 0.85

Tested by

no test coverage detected