This repository contains examples and practical applications using Azure OpenAI, including API calls and integration with Semantic Kernel to create intelligent AI-based solutions.
Azure OpenAI provides access to OpenAI's AI models, such as GPT-4, GPT-3.5, Codex, and DALLΒ·E, hosted on the secure and scalable Microsoft Azure infrastructure. It enables the creation of intelligent applications that understand and generate natural language, automate tasks, and optimize business processes.
β
Text Generation β Automated content creation, virtual assistants, and summaries.
β
Natural Language Analysis β Understanding and extracting insights from texts.
β
Text Translation and Rephrasing β Automatic writing improvements and language translation.
β
Code Generation with Codex β Assistance in writing code for various programming languages.
β
Image Creation with DALLΒ·E β Generating images based on textual descriptions.
β
Integration with Semantic Kernel β Using AI to create dynamic and personalized workflows.
This repository explores how to use Azure OpenAI in practice, with examples that include:
πΉ API Calls β How to interact with Azure OpenAI models using REST APIs.
πΉ Using Azure SDK β Implementing calls via Python and other languages.
πΉ Integration with Semantic Kernel β Building dynamic applications that combine AI with custom workflows.
πΉ Practical Use Cases β Applications in chatbots, virtual assistants, customer service automation, and sentiment analysis.
The Azure OpenAI API allows developers to interact directly with AI models via REST calls. This enables flexible and scalable integration of artificial intelligence into various applications.
import openai openai.api_type = "azure" openai.api_base = "https://your-endpoint.openai.azure.com/" openai.api_key = "your-key-here" openai.api_version = "2023-06-01-preview" response = openai.ChatCompletion.create( engine="gpt-4", messages=[{"role": "user", "content": "Hello, how are you?"}] ) print(response["choices"][0]["message"]["content"])
This API can be used for various purposes, including process automation, text analysis, and content generation.
Semantic Kernel is an SDK that enables the creation of AI-based applications, combining OpenAI models with custom workflows and integration with enterprise systems.
β
Contextual Memory β Manages and stores information over time.
β
Task Orchestration β Enables the execution of complex workflows using AI.
β
Extensibility β Easy integration with other Azure and OpenAI services.
from semantic_kernel import Kernel kernel = Kernel() kernel.add_openai_chat_completion( model_name="gpt-4", api_key="your-key-here", api_base="https://your-endpoint.openai.azure.com/" ) response = kernel.run("Explain the importance of Azure OpenAI in a few words.") print(response)
Semantic Kernel enables the creation of highly interactive and contextual AI solutions, allowing greater customization and control over the user experience.