Skip to content

🐳 Azure OpenAI / OpenAI Samples - πŸͺ‚ 70+ Code Cookbook πŸ§ͺ

Notifications You must be signed in to change notification settings

kimtth/azure-openai-cookbook

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

2 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Azure OpenAI Samples

Static Badge GitHub Created At

πŸ“Œ Quick Reference: Code Cookbook / Sample Code Collection

Note

To explore relevant demo codes across various repositories, you'll need to click through serveral pages and review them back and forth.

This repository's topic-based reclassification reduces the time spent reviewing code and contains demo code copied from various sources to showcase minimal implementations.

Important

πŸ”ΉFor more details and the latest code updates, please refer to the original link provided in the README.md file within each directory.
πŸ”ΉDisclaimer: This repository is created to collect sample code. Configuration for execution is not included, and it contains code that does not utilize LLMs. The focus is on collecting samples relevant to Azure OpenAI and OpenAI as much as possible.

πŸ“– Repository structure

πŸ“ agent

  • agent_debates_with_tools
  • agent_multi-agent_pattern
  • agent_planning_pattern
  • agent_react_pattern
  • agent_reflection_pattern
  • agent_tool_use_pattern
  • role_playing

πŸ“ azure

  • azure_ai_foundry_sft_finetuning
  • azure_ai_search
  • azure_bot
  • azure_cosmos_db
  • azure_postgres_db
  • azure_sql_db
  • sharepoint_azure_function

πŸ“ data

  • azure_oai_usage_stats_(power_bi)
  • chain-of-thought
  • fabric_cosmosdb_chat_analytics
  • presidio_(redaction)
  • prompt_buddy_(power_app)
  • sammo_(prompt_opt)
  • semantic_chunking_(rag)

πŸ“ eval_safety

  • evaluation_llm_as_judge
  • guardrails
  • pyrit_(safety_eval)

πŸ“ framework_dev

  • autogen_(framework)
  • code_editor_(vscode)
  • diagram_to_infra_template
  • e2e_testing_agent
  • gui_automation
  • guidance_(framework)
  • magentic-one_(agent)
  • mcp_(model_context_protocol)
  • memory_for_llm
  • mini-copilot
  • omniparser_(gui)
  • prompt_flow_(framework)
  • semantic_kernel_(framework)
  • tiny_troupe_(framework)

πŸ“ industry

  • auto_insurance_claims
  • career_assistant_agent
  • contract_review
  • customer_support_agent
  • damage_insurance_claims
  • invoice_+_sku_matching
  • invoice_payments
  • invoice_unit_standardization
  • music_compositor_agent
  • news_summarization_agent
  • nyc_taxi_pickup_(ui)
  • patient_case_summary
  • project_management
  • stock_analysis
  • travel_planning_agent

πŸ“ multi_modal

  • image_gen
  • video_understanding
  • vision_rag
  • visualize_embedding
  • voice_audio

πŸ“ nlp

  • multilingual_translation_(co-op-translator)
  • search_the_internet_and_summarize
  • sentiment_analysis_for_customer_feedback
  • translate_manga_into_english
  • txt2sql

πŸ“ rag

  • adaptive-rag
  • agentic_rag
  • contextual_retrieval_(rag)
  • corrective_rag
  • fusion_retrieval_reranking_(rag)
  • graphrag
  • hyde_(rag)
  • query_rewriting_(rag)
  • raptor_(rag)
  • self_rag

πŸ“ research_analysis

  • analysis_of_twitter_the-algorithm_source_code
  • deep_research
  • openai_code_interpreter
  • r&d-agent

πŸ“š References

πŸ’» Microsoft Frameworks and Libraries

  1. Semantic Kernel (Feb 2023): An open-source SDK for integrating AI services like OpenAI, Azure OpenAI, and Hugging Face with conventional programming languages such as C# and Python. It's an LLM orchestrator, similar to LangChain. / git / x-ref GitHub Repo stars
  2. Azure ML Prompt Flow (Jun 2023): A visual designer for prompt crafting using Jinja as a prompt template language. / ref / git GitHub Repo stars
  3. SAMMO (Apr 2024): A general-purpose framework for prompt optimization. / ref GitHub Repo stars
  4. guidance (Nov 2022): A domain-specific language (DSL) for controlling large language models, focusing on model interaction and implementing the "Chain of Thought" technique. GitHub Repo stars
  5. Autogen (Mar 2023): A customizable and conversable agent framework. / ref / Autogen Studio (June 2024) GitHub Repo stars
  6. UFO (Mar 2024): A UI-focused agent for Windows OS interaction. GitHub Repo stars
  7. OmniParser (Sep 2024): A simple screen parsing tool towards pure vision based GUI agent. GitHub Repo stars
  8. TinyTroupe: LLM-powered multiagent persona simulation for imagination enhancement and business insights. [Mar 2024] GitHub Repo stars
  9. RD-Agent: open source R&D automation tool ref [Apr 2024] GitHub Repo stars
  10. Magentic-One: Built on AutoGen. A Generalist Multi-Agent System for Solving Complex Tasks [Nov 2024]
  11. PyRIT (Dec 2023): Python Risk Identification Tool for generative AI, focusing on LLM robustness against issues like hallucination, bias, and harassment. GitHub Repo stars
  12. Presidio: Presidio (Origin from Latin praesidium β€˜protection, garrison’). Context aware, pluggable and customizable data protection and de-identification SDK for text and images. [Oct 2019]
  13. Microsoft Fabric: Fabric integrates technologies like Azure Data Factory, Azure Synapse Analytics, and Power BI into a single unified product [May 2023]

➑️ Convert ipynb to Python

  • To convert a Jupyter notebook (.ipynb) into a runnable Python scrip
pip install nbformat nbconvert
import nbformat
from nbconvert import PythonExporter

# Load the notebook
notebook_filename = 'your_notebook.ipynb'
with open(notebook_filename, 'r', encoding='utf-8') as notebook_file:
    notebook_content = nbformat.read(notebook_file, as_version=4)

# Convert the notebook to a Python script
python_exporter = PythonExporter()
python_code, _ = python_exporter.from_notebook_node(notebook_content)

# Save the converted Python code to a .py file
python_filename = notebook_filename.replace('.ipynb', '.py')
with open(python_filename, 'w', encoding='utf-8') as python_file:
    python_file.write(python_code)

print(f"Notebook converted to Python script: {python_filename}")

Contributor πŸ‘€

β“’ https://github.com/kimtth all rights reserved.