{"id":48542194,"url":"https://github.com/gnh1201/azure_inference_types","last_synced_at":"2026-04-08T05:02:43.495Z","repository":{"id":347093735,"uuid":"1192846646","full_name":"gnh1201/azure_inference_types","owner":"gnh1201","description":"OpenAI message type adapters for Azure AI Inference based applications","archived":false,"fork":false,"pushed_at":"2026-03-26T16:21:45.000Z","size":10,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-27T06:46:03.916Z","etag":null,"topics":["azure","microsoft","openai","types"],"latest_commit_sha":null,"homepage":"https://catswords.social/@catswords_oss","language":"Python","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/gnh1201.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}},"created_at":"2026-03-26T16:08:46.000Z","updated_at":"2026-03-26T16:22:57.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/gnh1201/azure_inference_types","commit_stats":null,"previous_names":["gnh1201/azure_inference_types"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/gnh1201/azure_inference_types","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnh1201%2Fazure_inference_types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnh1201%2Fazure_inference_types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnh1201%2Fazure_inference_types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnh1201%2Fazure_inference_types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gnh1201","download_url":"https://codeload.github.com/gnh1201/azure_inference_types/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gnh1201%2Fazure_inference_types/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31540827,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"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":["azure","microsoft","openai","types"],"created_at":"2026-04-08T05:02:27.969Z","updated_at":"2026-04-08T05:02:43.487Z","avatar_url":"https://github.com/gnh1201.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# azure_inference_types\n\n[![Discord chat](https://img.shields.io/discord/359930650330923008?logo=discord)](https://discord.gg/Y9RYCWbTwA?utm_source=catswords)\n\nOpenAI message type adapters for Azure AI Inference based applications\n\n## Overview\n\nThis module provides message adapters that bridge Azure AI Inference–based applications and the OpenAI SDK.\n\nIt enables seamless migration by allowing you to reuse familiar message structures while converting them into a format compatible with the OpenAI API.\n\n## Before (Azure AI Inference style)\n\n```python\nmessages = [\n    AssistantMessage(content=message1),\n    SystemMessage(content=message2),\n    UserMessage(content=message3),\n]\n\nresponse = client.complete(\n    messages=messages,\n    max_tokens=4096,\n    temperature=0,\n    top_p=0.1,\n    presence_penalty=0.0,\n    frequency_penalty=0.0,\n    model=model_name\n)\n```\n\n## After (Using message adapters)\n\n```python\nfrom .azure_inference_types import InferenceContext, SystemMessage, UserMessage, DeveloperMessage, AssistantMessage\n\nmessages = InferenceContext([\n    AssistantMessage(content=message1),\n    SystemMessage(content=message2),\n    UserMessage(content=message3),\n])\n\nresponse = client.chat.completions.create(\n    messages=messages.to_list(),\n    max_tokens=4096,\n    temperature=0,\n    top_p=0.1,\n    presence_penalty=0.0,\n    frequency_penalty=0.0,\n    model=model_name\n)\n```\n\n## Key Features\n\n* Message adapters for Azure AI Inference → OpenAI SDK compatibility\n* Minimal changes required for existing codebases\n* Clear and structured message construction\n* Built-in conversion via `to_list()` for OpenAI API requests\n* Extensible design for additional backends or adapters\n\n## How It Works\n\n* `InferenceContext` acts as a container for messages\n* Each message type (`SystemMessage`, `UserMessage`, etc.) represents a role-based structure\n* `to_list()` converts the entire message set into the format required by the OpenAI API\n\n## Notes\n\n* The API call changes from `client.complete()` to `client.chat.completions.create()`\n* The adapter layer ensures compatibility without requiring a full rewrite of message handling logic\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnh1201%2Fazure_inference_types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgnh1201%2Fazure_inference_types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgnh1201%2Fazure_inference_types/lists"}