This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@minLength(1) | |
@description('Primary location for all resources') | |
param location string | |
@description('The AI Hub resource name.') | |
param hubName string | |
@description('The AI Project resource name.') | |
param projectName string | |
@description('The Storage Account resource ID.') | |
param storageAccountId string = '' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# pip install azure-identity | |
# pip install pydantic-ai | |
from openai import AsyncAzureOpenAI | |
from azure.identity.aio import ( | |
AzureCliCredential, | |
get_bearer_token_provider, | |
) | |
from pydantic_ai import Agent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
name: Tutorness | |
description: Evaluates how well the responses simulate a tutor | |
model: | |
api: chat | |
parameters: | |
temperature: 0.0 | |
max_tokens: 800 | |
top_p: 1.0 | |
presence_penalty: 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import openai | |
import prompty | |
import prompty.azure | |
# execute the prompt | |
try: | |
response = prompty.execute("approaches/prompts/chat_answer_question.prompty", | |
configuration={ | |
"api_version": "2024-06-01", | |
"azure_endpoint": "https://cog-xxk4qzq3tahic.openai.azure.com", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import asyncio | |
import json | |
import logging | |
import os | |
from pathlib import Path | |
from typing import Any, Dict, List, Optional | |
import requests | |
from azure.ai.evaluation.simulator import Simulator | |
from azure.identity import AzureDeveloperCliCredential |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
import os | |
from azure.identity import AzureDeveloperCliCredential, get_bearer_token_provider | |
from dotenv import load_dotenv | |
from openai import AzureOpenAI | |
load_dotenv(override=True) | |
logging.basicConfig(level=logging.DEBUG) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"github.copilot.chat.codeGeneration.instructions": [ | |
{ | |
"text": "Always add a comment: 'Generated by Copilot'." | |
}, | |
{ | |
"text": "In Python always adhere to PEP8. Prefer pandas over polars. Prefer argparse over click." | |
}, | |
{ | |
"text": "Use type annotations when writing python function signatures and classes." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import json | |
import os | |
import requests | |
from datetime import datetime | |
import urllib.parse | |
from bs4 import BeautifulSoup | |
from rich import print | |
import openai | |
from pydantic import BaseModel | |
from azure.identity import AzureDeveloperCliCredential, get_bearer_token_provider |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import bs4 | |
import requests | |
import rich | |
from openai import OpenAI | |
from pydantic import BaseModel | |
client = OpenAI( | |
base_url="https://models.inference.ai.azure.com", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# print python version | |
import sys | |
print(sys.version) | |
import math | |
if True: | |
wow = f"""this is a multiline f string with triple quotes {math.pi:0.2f} : | |
1. Line 1 | |
2. Line 3 {math.pi:0.2f}""" |
NewerOlder