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
from typing import Any, Dict, Text | |
import structlog | |
from langchain.schema.embeddings import Embeddings | |
from langchain.vectorstores import FAISS | |
from rasa.core.information_retrieval import ( | |
InformationRetrieval, | |
InformationRetrievalException, | |
SearchResultList, | |
) |
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 argparse | |
import os | |
import requests | |
from typing import List | |
from pathlib import Path | |
from langchain.schema import Document | |
from langchain.schema.embeddings import Embeddings |
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
from __future__ import annotations | |
from typing import Any, Dict | |
import structlog | |
from addons.custom_information_retrieval.custom_faiss_vector_store import CustomFaissVectorStoreWithMetadata | |
from rasa.document_retrieval.constants import ( | |
POST_PROCESSING_CONFIG_KEY, | |
QUERY_REWRITING_CONFIG_KEY, |
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
from pathlib import Path | |
from typing import TYPE_CHECKING, Any, Dict, List, Optional, Text | |
import structlog | |
from langchain.text_splitter import RecursiveCharacterTextSplitter | |
from langchain_community.document_loaders.directory import DirectoryLoader | |
from langchain_community.document_loaders.text import TextLoader | |
from langchain_community.vectorstores.faiss import FAISS | |
from rasa.core.information_retrieval import ( |
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 argparse | |
import copy | |
import io | |
import os | |
import sys | |
from ruamel.yaml import YAML | |
from typing import Any, Dict, List, Union, Text | |
# ANSI color codes for pretty output. | |
YELLOW = "\033[33m" |
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
{ | |
"event": "action", | |
"timestamp": 1738252319.367319, | |
"metadata": { | |
"model_id": "cf102bc246c7480caa8f5db33fb51aa7", | |
"assistant_id": "20240418-073244-narrow-archive" | |
}, | |
"name": "action_session_start", | |
"policy": null, | |
"confidence": 1.0, |
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
from typing import AsyncIterator, Dict | |
import os | |
import json | |
import base64 | |
from rasa.core.channels.voice_stream.audio_bytes import RasaAudioBytes | |
from rasa.core.channels.voice_stream.tts.tts_engine import TTSEngine | |
OPENAI_API_KEY = "OPENAI_API_KEY" | |
SYSTEM_MESSAGE = ( | |
"""You are a helpful, creative, clever, and very friendly, for each user message as text, |
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
library(dplyr) | |
library(jsonlite) | |
library(httr) | |
ids <- c("439e7ee6814b4f1590e46095c7ac573d","167c47df27eb4719bf02f4cf0dea70c3") | |
comments <- c("API test reject 1!", "API test reject 2!") | |
user <- "username" | |
password <- "password" | |
# function archive one assignment |
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
folder <- '/Computer/my_data_folder' | |
# read and rename folder for appending | |
read_rename <- function(x){ | |
require(dplyr) # for data manipulation | |
require(stringr) # for string functions | |
require(readr) # for reading in tab files | |
df <- read_tsv(x) %>% | |
# removes digit at the end |
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
label_data <- function(dofile, format='tab'){ | |
load_pkg <- function(x) { | |
if (!require(x, character.only = TRUE)) { | |
install.packages(x, repos = 'https://cloud.r-project.org/', dep = TRUE) | |
} | |
require(x, character.only = TRUE) | |
} | |
load_pkg('haven') |