{"id":31816202,"url":"https://github.com/abraham/github-models-dart","last_synced_at":"2025-10-11T09:44:50.584Z","repository":{"id":317247210,"uuid":"1062747254","full_name":"abraham/github-models-dart","owner":"abraham","description":"Dart classes for GitHub Models prompt files","archived":false,"fork":false,"pushed_at":"2025-09-29T19:03:36.000Z","size":112,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-29T20:22:08.741Z","etag":null,"topics":["ai","dart","flutter","github-models"],"latest_commit_sha":null,"homepage":"","language":"Dart","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/abraham.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":"abraham"}},"created_at":"2025-09-23T17:08:46.000Z","updated_at":"2025-09-29T19:03:39.000Z","dependencies_parsed_at":"2025-09-29T20:22:17.863Z","dependency_job_id":"fb756efa-f34c-4b4a-9bc5-7a98f8b336d8","html_url":"https://github.com/abraham/github-models-dart","commit_stats":null,"previous_names":["abraham/github-models-dart"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/abraham/github-models-dart","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fgithub-models-dart","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fgithub-models-dart/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fgithub-models-dart/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fgithub-models-dart/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/abraham","download_url":"https://codeload.github.com/abraham/github-models-dart/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/abraham%2Fgithub-models-dart/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279006758,"owners_count":26084184,"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","status":"online","status_checked_at":"2025-10-11T02:00:06.511Z","response_time":55,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["ai","dart","flutter","github-models"],"created_at":"2025-10-11T09:44:45.676Z","updated_at":"2025-10-11T09:44:50.576Z","avatar_url":"https://github.com/abraham.png","language":"Dart","funding_links":["https://github.com/sponsors/abraham"],"categories":[],"sub_categories":[],"readme":"# github-models-dart\n\nA Dart package for working with GitHub Models prompt specifications. This package provides type-safe models for parsing and generating GitHub Models prompt configurations, but does not directly interface with the GitHub Models API.\n\n## Installation\n\nAdd this package to your `pubspec.yaml`:\n\n```yaml\ndependencies:\n  github_models: ^0.1.0\n```\n\nThen run:\n\n```bash\ndart pub get\n```\n\n## Usage\n\n### Basic Import\n\n```dart\nimport 'package:github_models/github_models.dart';\n```\n\n### Loading from YAML Data\n\nThe most common use case is parsing YAML prompt specifications:\n\n```dart\nimport 'package:github_models/github_models.dart';\n\nvoid main() {\n  // Example YAML data as a Map\n  final yamlData = {\n    'model': 'gpt-4',\n    'name': 'Code Assistant',\n    'description': 'Helps with coding tasks',\n    'version': '2.0.0',\n    'messages': [\n      {'role': 'system', 'content': 'You are a coding assistant.'},\n      {'role': 'user', 'content': 'Explain recursion.'},\n    ],\n    'model_parameters': {\n      'temperature': 0.3,\n      'top_p': 0.7,\n    },\n  };\n\n  // Parse YAML data into Prompt model\n  final prompt = Prompt.fromYaml(yamlData);\n  \n  print('Loaded prompt: ${prompt.name}');\n}\n```\n\n### Creating Prompts Programmatically\n\nCreate a simple prompt:\n\n```dart\nimport 'package:github_models/github_models.dart';\n\nvoid main() {\n  final prompt = Prompt(\n    model: 'gpt-4',\n    name: 'My Assistant',\n    description: 'A helpful AI assistant',\n    version: '1.0.0',\n    messages: [\n      Message(role: 'system', content: 'You are a helpful assistant.'),\n      Message(role: 'user', content: 'Hello!'),\n    ],\n  );\n\n  print('Prompt: ${prompt.name}');\n  print('Messages: ${prompt.messages?.length}');\n}\n```\n\n### Complete Example with All Features\n\n```dart\nimport 'package:github_models/github_models.dart';\n\nvoid main() {\n  // Create a comprehensive prompt with all available features\n  final prompt = Prompt(\n    model: 'gpt-4',\n    name: 'Creative Writing Assistant',\n    description: 'A prompt for creative writing assistance',\n    version: '1.2.0',\n    messages: [\n      Message(\n        role: 'system',\n        content: 'You are a creative writing assistant that helps users improve their stories.',\n      ),\n      Message(\n        role: 'user',\n        content: 'Help me write a short story about a magical forest.',\n      ),\n    ],\n    modelParameters: ModelParameters(\n      temperature: 0.8,\n      topP: 0.9,\n    ),\n    testData: [\n      TestData(\n        name: 'creative_test',\n        description: 'Test creative writing capabilities',\n        inputData: {\n          'prompt': 'Write about a magical forest',\n          'style': 'fantasy'\n        },\n        expectedOutput: {\n          'contains': ['forest', 'magical', 'story'],\n          'word_count': 200,\n        },\n      ),\n    ],\n  );\n\n  // Access prompt properties\n  print('Prompt Name: ${prompt.name}');\n  print('Version: ${prompt.version}');\n  print('Messages: ${prompt.messages?.length}');\n  print('Temperature: ${prompt.modelParameters?.temperature}');\n  print('Top-P: ${prompt.modelParameters?.topP}');\n  print('Test Cases: ${prompt.testData?.length}');\n\n  // Convert to JSON\n  final json = prompt.toJson();\n  print('JSON Keys: ${json.keys.join(', ')}');\n}\n```\n\n## API Overview\n\nThe package includes the following main classes:\n\n- **`Prompt`** - Root model representing a complete GitHub Models prompt specification\n- **`Message`** - Represents individual messages in a conversation with role and content\n- **`ModelParameters`** - Contains model-specific parameters like temperature and top_p\n- **`TestData`** - Defines test cases for validating prompts\n\nAll models support:\n- JSON serialization with `toJson()`\n- JSON deserialization with `fromJson()`\n- YAML parsing with `fromYaml()`\n- Immutable data structures with copy functionality\n\n## License\n\nMIT License - see the [LICENSE](LICENSE) file for details.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabraham%2Fgithub-models-dart","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fabraham%2Fgithub-models-dart","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fabraham%2Fgithub-models-dart/lists"}