MCPcopy Index your code
hub / github.com/Noumena-Network/code / promptTextForToolObligation

Function promptTextForToolObligation

src/QueryEngine.ts:1250–1272  ·  view source on GitHub ↗
(
  prompt: string | Array<ContentBlockParam>,
)

Source from the content-addressed store, hash-verified

1248]
1249
1250function promptTextForToolObligation(
1251 prompt: string | Array<ContentBlockParam>,
1252): string {
1253 if (typeof prompt === 'string') {
1254 return prompt
1255 }
1256 return prompt
1257 .map(block => {
1258 if (
1259 block &&
1260 typeof block === 'object' &&
1261 'type' in block &&
1262 block.type === 'text' &&
1263 'text' in block &&
1264 typeof block.text === 'string'
1265 ) {
1266 return block.text
1267 }
1268 return ''
1269 })
1270 .filter(Boolean)
1271 .join('\n')
1272}
1273
1274function hasActionableTools(tools: Tools): boolean {
1275 return tools.some(tool =>

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected