This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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}""" |
This file contains hidden or 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 json | |
| from dotenv import load_dotenv | |
| from openai import AzureOpenAI | |
| import requests | |
| load_dotenv(".env", override=True) |
This file contains hidden or 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
| -- Hybrid search with real time translation. Combining pgvector, postgis, azure_local_ai, azure_ai, Azure Language Services | |
| WITH listings_cte AS ( | |
| SELECT l.listing_id, name, listing_location, summary FROM listings l | |
| INNER JOIN calendar c ON l.listing_id = c.listing_id | |
| WHERE ST_DWithin( | |
| listing_location::geography, | |
| ST_GeographyFromText('POINT(-122.349358 47.620422)') | |
| ,3218 ) | |
| AND c.date = '2016-01-13' | |
| AND c.available = 't' |