{"id":25056973,"url":"https://github.com/finndersen/ai_framework_demo","last_synced_at":"2025-05-07T10:49:03.210Z","repository":{"id":274475521,"uuid":"922664887","full_name":"Finndersen/ai_framework_demo","owner":"Finndersen","description":"A project comparing the implementations of a basic AI agent using Langchain and PydanticAI frameworks","archived":false,"fork":false,"pushed_at":"2025-01-27T14:34:38.000Z","size":19,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-31T09:17:44.384Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Finndersen.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2025-01-26T19:42:17.000Z","updated_at":"2025-03-21T15:09:46.000Z","dependencies_parsed_at":"2025-01-27T15:36:30.406Z","dependency_job_id":"64bcbdbe-6cb7-460d-8f9a-100e6f6149aa","html_url":"https://github.com/Finndersen/ai_framework_demo","commit_stats":null,"previous_names":["finndersen/ai_framework_demo"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finndersen%2Fai_framework_demo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finndersen%2Fai_framework_demo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finndersen%2Fai_framework_demo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Finndersen%2Fai_framework_demo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Finndersen","download_url":"https://codeload.github.com/Finndersen/ai_framework_demo/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252863369,"owners_count":21816019,"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-02-06T13:39:55.616Z","updated_at":"2025-05-07T10:49:03.167Z","avatar_url":"https://github.com/Finndersen.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AI Agent Framework Comparison\n\nExample implementations of a basic conversational AI agent using different frameworks and approaches:\n- [Langchain](https://github.com/langchain-ai/langchain) Agent\n- [PydanticAI](https://github.com/pydantic/pydantic-ai) Agent\n\n## Overview\n\nThis project includes implementations of a basic conversational AI agent which acts as a waiter at a restaurant, \nasking about dietary requirements and taking your order. \nThey aim to demonstrate how the following features can be achieved with each approach:\n- Dynamic model choice\n- Human-in-the-loop input\n- Tool calling with dependencies\n- Conversation history/memory\n- Dynamic system prompt\n- Structured output\n\n## Example Conversation\n\n\u003e **AI Waiter:** Ah, bonjour madame et monsieur! Welcome to Le Bistro, where the food is as delightful as the company! Before we embark on a culinary adventure, might you have any dietary restrictions or preferences? We wouldn't want any rogue ingredients crashing the party!\n\n\u003e **You:** I only eat yellow coloured food\n\n\u003e **AI Waiter:** Magnifique! A connoisseur of the golden hue, I see! Let's explore the menu with your sunshine-filled preference in mind. For appetizers, we have the Quinoa Stuffed Bell Peppers, which are a vibrant yellow. For the main course, the Chickpea and Sweet Potato Curry is a golden delight! And for \ndessert, the Fresh Fruit Sorbet might have some yellow options depending on the day! What do you think?\n\n\u003e **You:** I'll take the Bell Peppers and fruit sorbet thanks\n\n\u003e **AI Waiter:** Excellent choices! One order of the Quinoa Stuffed Bell Peppers and the Fresh Fruit Sorbet for the discerning palate at table number 1! Your order has been placed, and I shall return with your delectable delights shortly. Au revoir!\n\n\u003e **Order placed:** [Order(menu_items=['Quinoa Stuffed Bell Peppers', 'Fresh Fruit Sorbet'], table_number=1)]\n\n\n## Implementations\n### Standard Agents\nThese approaches use PydanticAI's `Agent` and LangChain's legacy `AgentExecutor` classes to build the agent,\nimplementing the `AgentRunner` [common interface](./src/ai_framework_demo/run_agent.py). \n\n- PydanticAI implementation: [pydanticai/agent.py](./src/ai_framework_demo/pydantic_ai/agent.py)\n- LangChain implementation: [langchain/agent.py](./src/ai_framework_demo/langchain/agent.py)\n\n### Graph-based Agents\n\nTBC\n\n## Requirements\n\n- Python 3.11+\n- API key for LLM provider (e.g., OpenAI, Anthropic, Gemini)\n\n## Usage\n\n1. Install from the repository:\n```\npip install git@https://github.com/Finndersen/ai-framework-comparison.git\n```\n\n2. Run via CLI:\n```\npython -m ai_framework_comparison \u003cframework\u003e --model=\u003cprovider:model_name\u003e --api_key=\u003capi_key\u003e\n```\n\nRun `python -m ai_framework_comparison -h` for details about the available options.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinndersen%2Fai_framework_demo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffinndersen%2Fai_framework_demo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffinndersen%2Fai_framework_demo/lists"}