{"id":28590023,"url":"https://github.com/lenml/pflow","last_synced_at":"2025-06-28T23:35:20.589Z","repository":{"id":294497749,"uuid":"986705613","full_name":"lenML/pflow","owner":"lenML","description":"LLM framework pocketflow-like.","archived":false,"fork":false,"pushed_at":"2025-06-07T15:48:32.000Z","size":106,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-07T16:42:28.656Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lenML.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-05-20T02:30:38.000Z","updated_at":"2025-06-07T15:48:37.000Z","dependencies_parsed_at":"2025-05-20T18:38:58.038Z","dependency_job_id":null,"html_url":"https://github.com/lenML/pflow","commit_stats":null,"previous_names":["lenml/pflow"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenML%2Fpflow","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenML%2Fpflow/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenML%2Fpflow/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenML%2Fpflow/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lenML","download_url":"https://codeload.github.com/lenML/pflow/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lenML%2Fpflow/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259227962,"owners_count":22824907,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-11T08:12:31.263Z","updated_at":"2025-06-11T08:13:21.435Z","avatar_url":"https://github.com/lenML.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pflow\n\nenhancement pocket-flow\n\n## features\n\n- typing safety\n- Practical Experience\n\n# usage\n\n```ts\nimport { Node, Flow, Shared, Action } from \"@lenml/pflow\";\n\n// ... some utils\n\ninterface Message {\n  role: string;\n  content: string;\n}\ntype Messages = Message[];\n\nclass ChatNode extends Node\u003cShared\u003c{ messages: Messages }\u003e\u003e {\n  async prep(): Promise\u003cMessages | null\u003e {\n    const { messages } = this._shared.data;\n    const user_input = await prompt(\"User: \");\n\n    if (user_input === \"exit\") {\n      return null;\n    }\n\n    messages.push({ role: \"user\", content: user_input });\n    return messages;\n  }\n\n  async exec(prepRes: Messages | null): Promise\u003cunknown\u003e {\n    if (prepRes === null) return null;\n\n    const resp = await get_llm_completions(prepRes);\n\n    return resp.choices[0].message.content;\n  }\n\n  async post(\n    prepRes: Messages | null,\n    execRes: string\n  ): Promise\u003cAction | undefined\u003e {\n    if (prepRes === null || execRes === null) {\n      console.log(\"\\nGoodbye!\");\n      return undefined;\n    }\n\n    console.log(`\\nAssistant: ${execRes}`);\n\n    this._shared.data.messages.push({ role: \"assistant\", content: execRes });\n\n    return \"continue\";\n  }\n}\n\nconst shared = new Shared\u003c{\n  messages: Messages;\n}\u003e({ messages: [] });\nconst chat_node = new ChatNode();\nchat_node.on(\"continue\", chat_node);\nconst chat_flow = new Flow(chat_node);\n\nchat_flow.setShared(shared);\nchat_flow.run();\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flenml%2Fpflow","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flenml%2Fpflow","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flenml%2Fpflow/lists"}