Datasets:
_id stringlengths 21 179 | text stringlengths 1 15k | metadata dict |
|---|---|---|
azure-openai-samples/LICENSE_0_1070 | MIT License
Copyright (c) 2023 Azure Samples
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, dis... | {
"end_byte": 1070,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/LICENSE"
} |
azure-openai-samples/CONTRIBUTING.md_0_3941 | # Contributing to [project-title]
This project welcomes contributions and suggestions. Most contributions require you to agree to a
Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us
the rights to use your contribution. For details, visit https://cla.opensource.microso... | {
"end_byte": 3941,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/CONTRIBUTING.md"
} |
azure-openai-samples/LICENSE.md_0_1140 | MIT License
Copyright (c) Microsoft Corporation.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy,... | {
"end_byte": 1140,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/LICENSE.md"
} |
azure-openai-samples/CHANGELOG.md_0_135 | ## [project-title] Changelog
<a name="x.y.z"></a>
# x.y.z (yyyy-mm-dd)
*Features*
* ...
*Bug Fixes*
* ...
*Breaking Changes*
* ...
| {
"end_byte": 135,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/CHANGELOG.md"
} |
azure-openai-samples/README.md_0_5088 |
> [Note]
> **This repository is a work in progress and will be updated frequently with changes.**
# Azure OpenAI Service Samples
This repo is a compilation of useful [Azure OpenAI Service](https://azure.microsoft.com/en-us/products/cognitive-services/openai-service) resources and code samples to help you get sta... | {
"end_byte": 5088,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/README.md"
} |
azure-openai-samples/README.md_5088_13656 | Important concepts and terminology
#### Prompts & Completions
The completions endpoint is the core component of the API service. This API provides access to the model's text-in, text-out interface. Users simply need to provide an input prompt containing the English text command, and the model will generate a text comp... | {
"end_byte": 13656,
"start_byte": 5088,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/README.md"
} |
azure-openai-samples/End_to_end_Solutions/EnterpriseChatGPT_WithRediSearch [LINK]README.md_0_406 | # Azure OpenAI Embeddings QnA
A simple web application for a OpenAI-enabled document search. This solution uses Azure OpenAI Service for creating embeddings vectors from documents. For answering the question of a user, it retrieves the most relevant document and then uses GPT-3 to extract the matching answer for the qu... | {
"end_byte": 406,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/EnterpriseChatGPT_WithRediSearch [LINK]README.md"
} |
azure-openai-samples/End_to_end_Solutions/README.md_0_1041 | # End to End Solutions
These are complete solutions for some use cases and industry scenarios. These include appropriate workflows and reference architectures, which can be easily customized and built into full scale production systems.
| Sample | Language |
| --- | --- |
| [Azure OpenAI Search Demo](./AOAISearchDemo... | {
"end_byte": 1041,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/README.md"
} |
azure-openai-samples/End_to_end_Solutions/Call_center_intelligence [LINK]/README.md_0_1252 | # AI Powered Call Center Intelligence Accelerator
The Call Center Intelligence Accelerator drives huge cost saving in call center operations while improving call center efficiency & customer satisfaction.
It uses Azure Speech, Azure Language and Azure OpenAI (GPT-3) services to analyze call center transcrips, extract ... | {
"end_byte": 1252,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/Call_center_intelligence [LINK]/README.md"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md_0_4678 | # <span style="color:red">Important Note</span>
Please expect frequent updates and development of this demo to adapt to the changes
and development of OpenAI offering in Azure. Your feedback and contributions are welcome!
<em>This demo doesn't have full coverage of the scenario, and is more highlighting ideas with ho... | {
"end_byte": 4678,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md_4678_12842 | (Local)
Here are the steps to run the solution locally:
1. Install Python 3.9 and setup a [python virtual environment](https://docs.python.org/3.9/library/venv.html) to use for this solution
2. Clone the repo
3. Create the required Azure Resources:
- [Azure Bot](https://learn.microsoft.com/en-us/azure/bot-service/a... | {
"end_byte": 12842,
"start_byte": 4678,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md_12842_17325 | ow
- The following figure shows an overview of the solution

## Workflow components
* Topic Classifier: This is responsible to determine the topic of the user input. The topic not only includes the business-related concepts but extends to include iden... | {
"end_byte": 17325,
"start_byte": 12842,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md_17325_22889 | e Usage

For the above dialog and the current user input, the orchestrator fetches the user profile as well as the relevant information about home flood insurance, which include the
* Reasons to buy flood insurance:
1. Standard homeown... | {
"end_byte": 22889,
"start_byte": 17325,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/ReadMe.md"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/config.py_0_1547 | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
import os
from dotenv import load_dotenv
from azure.keyvault.secrets import SecretClient
from azure.identity import DefaultAzureCredential
load_dotenv()
def get_secret_from_keyvault( key_name:str):
... | {
"end_byte": 1547,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/config.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/orchestrator.py_0_3865 | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from data.chat_sessions.contracts.chat_session import DialogClassification
from data.chat_sessions.contracts.chat_session import ParticipantType
from tasks.chit_chat import ChitChat
from tasks.topic_classifier import TopicCla... | {
"end_byte": 3865,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/orchestrator.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/deployment.yaml_0_2381 | trigger:
branches:
include:
- main
paths:
include:
- AOAIVirtualAssistant/src/botapp
variables:
# Azure Resource Manager connection created during pipeline creation
azureServiceConnectionId: 'AZOAI_VA_ServiceConnection'
# Web app name
webAppName: 'aoai-va-botapp'
# Agent VM image name
vmI... | {
"end_byte": 2381,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/deployment.yaml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/main.py_0_951 | #!/usr/bin/env python3
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
from flask import Flask, request, jsonify
from data.conversation_store import ConversationStore
from orchestrator import Orchestrator
from config import DefaultConfig
app = Flask(__name__)
orchestrator... | {
"end_byte": 951,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/main.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/requirements.txt_0_137 | pyyaml
requests
tiktoken
flask
python-dotenv
prefect==1.4.1
azure-identity
azure-keyvault-secrets
requests_oauthlib
tenacity
azure-cosmos | {
"end_byte": 137,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/requirements.txt"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/inputdata.yml_0_2681 | data:
auto_insurance_data:
USER_INFO: |
Insurer's name: J. Kirk
Auto Insurance: Yes
Auto Insurance deductible: $500 per incident
Home Insurance: Yes
Bundling: Yes
Home Address: 100 Main Street, Seattle, WA
Flood risk factor: 6 of 10
Own or rent current residence: Own
C... | {
"end_byte": 2681,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/inputdata.yml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/config.yml_0_6781 | models:
topic-classifier:
prompt:
body: |
Classify customer's question. Classify between category 1 to 6.
Detailed Guidelines for how to choose:
choose 1 if the question is about auto insurance premium.
choose 2 if the question is about home flood insurance.
ch... | {
"end_byte": 6781,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/config.yml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/model_manager.py_0_3908 | from cognition.openai.api.client import OpenAIClient
from cognition.openai.api.completions.request_params import OpenAICompletionsParams
from cognition.openai.prompt import OpenAIPrompt, OpenAIPromptParameterSizeHandlerMethods
from cognition.openai.prompt import OpenAIPrompt
from utilities.yaml_reader import YAMLReader... | {
"end_byte": 3908,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/model_manager.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/prompt.py_0_4542 | from enum import Enum
from typing import Optional
"""
Defines the possible size handlers for a given prompt parameter.
"""
class OpenAIPromptParameterSizeHandlerMethods(Enum):
truncate = "truncate"
none = "none"
class OpenAIPromptSizeHandler():
def __init__(self, method: OpenAIPromptParameterSizeHandlerMe... | {
"end_byte": 4542,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/prompt.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/api/client.py_0_1948 | import requests
from tenacity import retry, stop_after_attempt, wait_exponential
from cognition.openai.api.completions.response import OpenAICompletionsResponse, OpenAICompletionsResponseChoice
from cognition.openai.api.completions.request_params import OpenAICompletionsParams
"""
Client class to make requests to Ope... | {
"end_byte": 1948,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/api/client.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/api/completions/request_params.py_0_525 | class OpenAICompletionsParams:
"""
Defines the body params for an OpenAI completions request.
"""
def __init__(self, **kwargs):
self.max_tokens = kwargs.get("max_tokens", 16)
self.temperature = kwargs.get("temperature", 0.0)
self.n = kwargs.get("n", 1)
self.stream = kwarg... | {
"end_byte": 525,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/api/completions/request_params.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/api/completions/response.py_0_2313 | from enum import Enum
import json
"""
Defines the finish reasons for an Open AI completions response choice.
"""
class OpenAICompletionsFinishReasons(Enum):
length = "length"
stop = "stop"
"""
Defines the structure of an Open AI completions response choice.
"""
class OpenAICompletionsResponseChoice:
def _... | {
"end_byte": 2313,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/cognition/openai/api/completions/response.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/chit_chat.py_0_1726 | import os
from data.chat_sessions.contracts.chat_session import DialogClassification
from cognition.openai.model_manager import OpenAIModelManager
from config import DefaultConfig
from data.chat_sessions.contracts.chat_session import ChatSession
from data.user_profiles.api.manager_flat import UserProfileManagerFlat
fr... | {
"end_byte": 1726,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/chit_chat.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/auto_insurance.py_0_2257 | import os
from data.chat_sessions.contracts.chat_session import DialogClassification
from data.chat_sessions.contracts.chat_session import ChatSession
from data.faqs.contracts.faq import InsuranceType
from cognition.openai.model_manager import OpenAIModelManager
from utilities.model_input_convertor import ModelInputCo... | {
"end_byte": 2257,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/auto_insurance.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/end_conversation.py_0_966 | import os
from prefect import Task
from cognition.openai.model_manager import OpenAIModelManager
from data.conversation_store import ConversationStore
from utilities.model_input_convertor import ModelInputConvertor
from config import DefaultConfig
class EndConversation(Task):
def __init__(self, conversation_store... | {
"end_byte": 966,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/end_conversation.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/topic_classifier.py_0_1046 | import os
from prefect import Task
from cognition.openai.model_manager import OpenAIModelManager
from config import DefaultConfig
class TopicClassifier(Task):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.name = "topic-classifier"
def run(self, query) -> str:
open_ai_c... | {
"end_byte": 1046,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/topic_classifier.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/flood_insurance.py_0_2404 | import os
from data.chat_sessions.contracts.chat_session import DialogClassification
from data.chat_sessions.contracts.chat_session import ChatSession
from data.faqs.contracts.faq import InsuranceType
from cognition.openai.model_manager import OpenAIModelManager
from utilities.model_input_convertor import ModelInputCo... | {
"end_byte": 2404,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/tasks/flood_insurance.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/conversation_store.py_0_964 | #
# Todo: can mostly be removed post integration with cosmos.
#
from data.dialog_turn import DialogTurn
from copy import deepcopy
class ConversationStore:
def __init__(self, **kwargs):
self.dialog_turn_messages = kwargs.get("dialog_turn_messages", list())
def add_message(self, message):
self.... | {
"end_byte": 964,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/conversation_store.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/dialog_turn.py_0_327 | #
# Todo: can mostly be removed post integration with cosmos.
#
class DialogTurn:
def __init__(self, **kwargs):
self.user_utterance = kwargs.get("user_utterance", "")
self.agent_response = kwargs.get("agent_response", "")
self.topic_classifier_response = kwargs.get("topic_classifier_response... | {
"end_byte": 327,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/dialog_turn.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/model_classes.py_0_179 | from enum import Enum
class ModelClasses(Enum):
AUTO_INSURANCE = "1"
HOME_FLOOD_INSURANCE = "2"
CHIT_CHAT = "4"
ENDING_CONVERSATION = "5"
CONTINUATION = "6"
| {
"end_byte": 179,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/model_classes.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/chat_sessions/contracts/chat_session.py_0_2131 | import datetime
from enum import Enum
from typing import List
from copy import deepcopy
class ParticipantType(Enum):
user = "user"
assistant = "assistant"
class DialogClassification(Enum):
chit_chat = "chit_chat"
auto_insurance = "auto_insurance"
flood_insurance = "flood_insurance"
end_convers... | {
"end_byte": 2131,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/chat_sessions/contracts/chat_session.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/chat_sessions/api/manager.py_0_5450 | import datetime
from typing import List, Optional
from data.model_classes import ModelClasses
from data.chat_sessions.contracts.chat_session import ChatSession, Dialog, DialogClassification, ParticipantType
from data.cosmosdb.api.container import CosmosDBContainer
from data.cosmosdb.utilities.property_item_reader impor... | {
"end_byte": 5450,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/chat_sessions/api/manager.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/faqs/contracts/faq.py_0_745 | from enum import Enum
from typing import Optional
class InsuranceType(Enum):
auto = "auto"
home = "home"
flood = "flood"
renters = "renters"
life = "life"
"""
Object representing all the information regarding a specific kind of insurance.
"""
class InsuranceInformation():
def __init__(self, re... | {
"end_byte": 745,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/faqs/contracts/faq.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/faqs/api/manager.py_0_1379 | from typing import Optional
from data.faqs.contracts.faq import InsuranceInformation
from data.faqs.contracts.faq import FAQ, InsuranceType
from data.cosmosdb.utilities.property_item_reader import read_item_property_with_type
from data.cosmosdb.api.container import CosmosDBContainer
"""
Manager API for retrieving insu... | {
"end_byte": 1379,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/faqs/api/manager.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/cosmosdb/api/container.py_0_2662 | import os
from typing import Any, Dict, List, Optional
from azure.cosmos import CosmosClient, PartitionKey
from azure.cosmos.exceptions import CosmosHttpResponseError
from config import DefaultConfig
class CosmosDBContainer:
def __init__(self, database_name: str, container_name: str, partition_key: str, unique_key... | {
"end_byte": 2662,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/cosmosdb/api/container.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/cosmosdb/utilities/property_item_reader.py_0_1418 | from typing import Any, Callable, List, Optional
def read_item_property_with_type(item: dict, property_name: str, expected_value_type: Any, object: Any, converter: Optional[Callable] = None, nullable: bool = False) -> Any:
property = _get_property_from_item(item, property_name, object)
if converter is not None... | {
"end_byte": 1418,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/cosmosdb/utilities/property_item_reader.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/contracts/user_profile.py_0_3651 | import datetime
from enum import Enum
from typing import List, Optional
from data.faqs.contracts.faq import InsuranceType
class AutoInsuranceClaim():
def __init__(self, claim_date: datetime.date, claim_amount: float, claim_reason: str):
self.claim_date = claim_date
self.claim_amount = claim_amount
... | {
"end_byte": 3651,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/contracts/user_profile.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/contracts/user_profile_flat.py_0_3490 | import datetime
from typing import List
from data.user_profiles.contracts.user_profile import AutoInsuranceClaim
"""
Object representing a flat-structure user profile.
"""
class UserProfileFlat:
def __init__(self, user_id: str, user_name: str, home_address: str, customer_since: datetime.date, auto_insurance: bool,... | {
"end_byte": 3490,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/contracts/user_profile_flat.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/api/manager_flat.py_0_4398 | import datetime
from typing import List, Optional
from data.user_profiles.contracts.user_profile_flat import UserProfileFlat
from data.user_profiles.contracts.user_profile import AutoInsuranceClaim
from data.cosmosdb.api.container import CosmosDBContainer
from data.cosmosdb.utilities.property_item_reader import read_it... | {
"end_byte": 4398,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/api/manager_flat.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/api/manager.py_0_6220 | import datetime
from typing import List, Optional
from data.faqs.contracts.faq import InsuranceType
from data.user_profiles.contracts.user_profile import AutoInsuranceClaim, AutoInsuranceProperties, FloodInsuranceProperties, HomeInsuranceProperties, PropertyStatus, UserProfile
from data.cosmosdb.api.container import Co... | {
"end_byte": 6220,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/data/user_profiles/api/manager.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/utilities/model_input_convertor.py_0_307 | class ModelInputConvertor:
@staticmethod
def model_input_convertor(transcript):
input_output_list = list()
for message in transcript:
if len(message.utterance) > 0:
input_output_list.append("user\n" + message.utterance)
return input_output_list
| {
"end_byte": 307,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/utilities/model_input_convertor.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/utilities/yaml_reader.py_0_164 | import yaml
class YAMLReader:
@staticmethod
def read_yaml(file_path) -> dict:
with open(file_path, "r") as f:
return yaml.safe_load(f) | {
"end_byte": 164,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botapp/utilities/yaml_reader.py"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Bot.sln_0_1092 |
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33403.182
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Bot.Web", "Bot.Web.csproj", "{35547553-DE3B-40BD-A133-3765D3947C21}"
EndProject
Global
GlobalSecti... | {
"end_byte": 1092,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Bot.sln"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Bot.Web.csproj_0_876 | <Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net7.0</TargetFramework>
<UserSecretsId>4d6a0c3c-9bb2-48d2-86ed-f0f3a08cac10</UserSecretsId>
<DockerDefaultTargetOS>Linux</DockerDefaultTargetOS>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.A... | {
"end_byte": 876,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Bot.Web.csproj"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/css/site.css_3_1346 | Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
for details on configuring this project to bundle and minify static web assets. */
a.navbar-brand {
white-space: normal;
text-align: center;
word-break: break-all;
}
/* Provide sufficient contrast against w... | {
"end_byte": 1346,
"start_byte": 3,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/css/site.css"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js_0_483 | // Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
/*jslint white: true, browser: true, onevar: true, undef: t... | {
"end_byte": 483,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js_485_9969 | (function (factory) {
if (typeof define === 'function' && define.amd) {
// AMD. Register as an anonymous module.
define("jquery.validate.unobtrusive", ['jquery-validation'], factory);
} else if (typeof module === 'object' && module.exports) {
// CommonJS-like environments that support mo... | {
"end_byte": 9969,
"start_byte": 485,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js_9975_17488 | adapters.add = function (adapterName, params, fn) {
/// <summary>Adds a new adapter to convert unobtrusive HTML into a jQuery Validate validation.</summary>
/// <param name="adapterName" type="String">The name of the adapter to be added. This matches the name used
/// in the data-val-nnnn HTML a... | {
"end_byte": 17488,
"start_byte": 9975,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js_17493_19365 | adapters.add("remote", ["url", "type", "additionalfields"], function (options) {
var value = {
url: options.params.url,
type: options.params.type || "GET",
data: {}
},
prefix = getModelPrefix(options.element.name);
$.each(splitAndTrim(options.para... | {
"end_byte": 19365,
"start_byte": 17493,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js_0_5867 | // Unobtrusive validation support library for jQuery and jQuery Validate
// Copyright (c) .NET Foundation. All rights reserved.
// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// @version v3.2.11
!function(a){"function"==typeof define&&define.amd?define("j... | {
"end_byte": 5867,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/jquery.validate.unobtrusive.min.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt_0_575 | Copyright (c) .NET Foundation. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
these files except in compliance with the License. You may obtain a copy of the
License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in w... | {
"end_byte": 575,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation-unobtrusive/LICENSE.txt"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation/LICENSE.md_0_1095 | The MIT License (MIT)
=====================
Copyright Jörn Zaefferer
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, mod... | {
"end_byte": 1095,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery-validation/LICENSE.md"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/bootstrap/LICENSE_0_1131 | The MIT License (MIT)
Copyright (c) 2011-2018 Twitter, Inc.
Copyright (c) 2011-2018 The Bootstrap Authors
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without li... | {
"end_byte": 1131,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/bootstrap/LICENSE"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery/LICENSE.txt_0_1605 | Copyright JS Foundation and other contributors, https://js.foundation/
This software consists of voluntary contributions made by many
individuals. For exact contribution history, see the revision history
available at https://github.com/jquery/jquery
The following license applies to all parts of this software except a... | {
"end_byte": 1605,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/jquery/LICENSE.txt"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/simple-update-in/simple-update-in.production.min.js_0_5370 | !function (t, e) { "object" == typeof exports && "undefined" != typeof module ? module.exports = e() : "function" == typeof define && define.amd ? define(e) : (t = t || self).simpleUpdateIn = e() }(this, function () { "use strict"; function l(t) { return (l = "function" == typeof Symbol && "symbol" == typeof Symbol.ite... | {
"end_byte": 5370,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/simple-update-in/simple-update-in.production.min.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/simple-update-in/simple-update-in.production.min.js_5371_7542 | function i() { return (i = t(regeneratorRuntime.mark(function t(e, r) { var n, o, a, i, u, c, f, s; return regeneratorRuntime.wrap(function (t) { for (; ;)switch (t.prev = t.next) { case 0: if (r.length) { t.next = 2; break } return t.abrupt("return"); case 2: if (n = b(r), o = n[0], a = n.slice(1), "function" != typeo... | {
"end_byte": 7542,
"start_byte": 5371,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/lib/simple-update-in/simple-update-in.production.min.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/js/site.js_3_226 | Please see documentation at https://docs.microsoft.com/aspnet/core/client-side/bundling-and-minification
// for details on configuring this project to bundle and minify static web assets.
// Write your JavaScript code.
| {
"end_byte": 226,
"start_byte": 3,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/wwwroot/js/site.js"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/Index.cshtml_0_5752 | @page
@using Newtonsoft.Json
@using Newtonsoft.Json.Linq
@using static Bot.Web.Pages.IndexModel
@model IndexModel
@{
ViewData["Title"] = "Home page";
}
<!DOCTYPE html>
<html lang="en-US">
<head>
<title>Web Chat: Cognitive Services Speech Services using JavaScript</title>
<meta name="viewport" content="widt... | {
"end_byte": 5752,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/Index.cshtml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/Privacy.cshtml_0_179 | @page
@model PrivacyModel
@{
ViewData["Title"] = "Privacy Policy";
}
<h1>@ViewData["Title"]</h1>
<p>Use this page to detail your site's privacy policy.</p>
<!DOCTYPE html>
| {
"end_byte": 179,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/Privacy.cshtml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/_ViewImports.cshtml_0_93 | @using Bot.Web
@namespace Bot.Web.Pages
@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers
| {
"end_byte": 93,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/_ViewImports.cshtml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/_ViewStart.cshtml_0_30 | @{
Layout = "_Layout";
}
| {
"end_byte": 30,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/_ViewStart.cshtml"
} |
azure-openai-samples/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/Error.cshtml_0_854 | @page
@model ErrorModel
@{
ViewData["Title"] = "Error";
}
<h1 class="text-danger">Error.</h1>
<h2 class="text-danger">An error occurred while processing your request.</h2>
@if (Model.ShowRequestId)
{
<p>
<strong>Request ID:</strong> <code>@Model.RequestId</code>
</p>
}
<h3>Development Mode</h3>
... | {
"end_byte": 854,
"start_byte": 0,
"url": "https://github.com/Azure-Samples/openai/blob/65eaeaf1bfc8e5dbf63a3cedcd525657b4133404/End_to_end_Solutions/AOAIVirtualAssistant/src/botwebapp/Bot.Web/Pages/Error.cshtml"
} |
End of preview. Expand in Data Studio
langchain-corpus-2024
LangChain documentation corpus from October 2024 snapshot. Contains chunked documentation with metadata for retrieval tasks.
Dataset Structure
Each entry in the dataset contains:
_id: Unique identifier for the document chunktext: The text content of the chunkmetadata: Dictionary containing:end_byte: End byte position in the original filestart_byte: Start byte position in the original fileurl: GitHub URL to the source file
Usage
from datasets import load_dataset
dataset = load_dataset("ngkuissi/langchain-corpus-2024")
Source
This dataset was created from GitHub repository snapshots.
- Downloads last month
- 16