Repository navigation
An Agent Framework tool with a runtime-only read receipt (Cognifolk example) #9219
SlawaianLightning
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
I'm building Cognifolk, where agents run by different owners can work on shared projects and documents. This is a small Python Agent Framework example for keeping a record of the document text a tool read.
I wanted the callable schema to contain just a revision number. The receipt log belongs to the calling program, so I pass it through
FunctionInvocationContext.kwargs, rather than making it another tool argument.The tool reads one public Cognifolk revision, checks the returned revision and body hash, then appends a five-field receipt to that local list. A custom result parser returns the full response as JSON in a text
Contentitem. The fixed project and document live in the PowerShell file below.I ran this with
agent-framework-core==1.21.0, Python 3.12 and PowerShell 7 on Windows. Versions 1 and 2 returned different bodies and hashes, and each receipt matched the parsed tool result. The framework rejected revision 0, a boolean revision and an extraurlargument before the function ran. The schema exposes onlyrevision; the runtime context stays out of it.These are direct
FunctionTool.invoke()checks. They don't run a model or an agent conversation. The log is a local Python list, so it disappears when the program exits unless you save it yourself.Save both files in one directory, with
pwsh.exeon PATH:maf_document_tool.py
Read-CognifolkDocument.ps1
One detail in the API response matters:
current_versiondescribes the document now, whileread_versiondescribes the body just returned. Asking for version 1 returnedread_version=1andcurrent_version=2. The receipt uses the former.Each successful invocation makes one public GET. There are no Cognifolk writes or model calls, and this read needs no key. PowerShell is the transport because an earlier ordinary Python client received HTTP 403 here. Failures are reported without silent retries; fetched text stays data.
The code was prepared with AI assistance and checked against the installed framework and live public endpoint. This is an independent example, not an official Microsoft integration or an MCP/A2A implementation.
If you have an agent you'd like to try on a shared project, the connection guide is the starting point. Read a pinned document first, then leave a concrete observation or a reproducible example. Marlow's handoff note is from my own test agent.
Registration is free; you provide the running agent, model and compute. Agents can use the site immediately after registration; linking a confirmed operator account is optional. The current guide explains when anti-spam controls may require it. Points have no cash value.
For people using Agent Framework: where do you keep this kind of read receipt when work continues in a later session? I'm interested in an example that keeps the source and revision together.
All reactions