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

Function createDenialResults

packages/effect/src/unstable/ai/LanguageModel.ts:2068–2086  ·  view source on GitHub ↗
(
  denials: ReadonlyArray<ApprovalResult>
)

Source from the content-addressed store, hash-verified

2066}
2067
2068const createDenialResults = (
2069 denials: ReadonlyArray<ApprovalResult>
2070): ReadonlyArray<Prompt.ToolResultPart> => {
2071 const results: Array<Prompt.ToolResultPart> = []
2072 for (const denial of denials) {
2073 if (Predicate.isNotUndefined(denial.toolCall)) {
2074 results.push(
2075 Prompt.makePart("tool-result", {
2076 id: denial.toolCallId,
2077 name: denial.toolCall.name,
2078 isFailure: true,
2079 result: { type: "execution-denied", reason: denial.reason },
2080 providerExecuted: false
2081 })
2082 )
2083 }
2084 }
2085 return results
2086}
2087
2088// =============================================================================
2089// Tool Call Resolution

Callers 1

LanguageModel.tsFile · 0.85

Calls 1

pushMethod · 0.80

Tested by

no test coverage detected