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 | |
# OpenAI Models used | |
OPENAI_GPT_35_MODEL = "gpt-3.5-turbo-16k" | |
OPENAI_GPT_4_MODEL = "gpt-4" | |
def is_valid_openai_creds( | |
openai_api_key: str, openai_organization_id: str | |
) -> Tuple[bool, str]: | |
"""Checks if OpenAI API Key and Organization ID is valid as well as have access to required OpenAI models""" |
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
""" | |
### How to use it ? | |
### Run following commands : | |
pip install simple-websocket-server==0.4.4 pydantic==2.1.1 | |
python3 qa_websocket_server.py | |
### Send following request in postman using websocket : | |
ws://localhost:8000 | |
{ | |
"id": "test123", |
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 time | |
import traceback | |
import base64 | |
from datetime import datetime | |
from langchain.chains.qa_with_sources import load_qa_with_sources_chain | |
from langchain.llms import OpenAI | |
from opentelemetry import trace | |
from opentelemetry.exporter.otlp.proto.http.trace_exporter import OTLPSpanExporter |
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
#!/usr/bin/env python3 | |
"""Command line interface for chalice. | |
Contains commands for deploying chalice. | |
""" | |
from __future__ import annotations | |
import functools | |
import logging | |
import os | |
import platform |
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: deploy-to-eyk | |
on: | |
push: | |
branches: | |
- main | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }} | |
cancel-in-progress: true |
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
// Install package before running this file : npm install ajv | |
// Node.js require: | |
var Ajv = require('ajv'); | |
var schema = { | |
"$schema": "http://json-schema.org/draft-07/schema#", | |
"$id": "http://example.com/example1.json", | |
"title": "Core schema meta-schema", | |
"definitions": { |
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 moto boto3 | |
import boto3 | |
from moto import mock_iam | |
@mock_iam | |
def test_create_user(): | |
iam_client = boto3.client('iam', region_name='us-east-1') | |
library_name = 'xyz' | |
response1 = iam_client.create_user( |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using Microsoft.CodeAnalysis; | |
using Microsoft.CodeAnalysis.CSharp; | |
using Microsoft.CodeAnalysis.CSharp.Syntax; | |
namespace GettingStartedCS |
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
# Created by https://www.gitignore.io/api/java,gradle,intellij+all | |
### Intellij+all ### | |
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | |
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | |
# User-specific stuff: | |
.idea/**/workspace.xml | |
.idea/**/tasks.xml | |
.idea/dictionaries |