Skip to content

Instantly share code, notes, and snippets.

using static LangChain.Chains.Chain;
using LangChain.Providers.OpenAI;
namespace XX.Backend.Services
{
public class OpenAILanguageModelService : ILanguageModelService
{
private readonly ILogger<OpenAILanguageModelService> _logger;
private readonly IConfiguration _configuration;
{
"kind": "discovery#restDescription",
"description": "Business logic for the Meetings app.",
"servicePath": "",
"rootUrl": "https://meetings.googleapis.com/",
"basePath": "",
"ownerDomain": "google.com",
"name": "meetings",
"batchPath": "batch",
"revision": "20181113",
/* tslint:disable */
export interface IOptions {
text: string;
width: number;
height: number;
colorDark: string;
colorLight: string;
correctLevel: CorrectLevel;
}
/* tslint:disable */
import { Component, Input, ElementRef, OnInit } from '@angular/core';
import { CorrectLevel, QRCodeConstructor } from './qrcode.interface';
import * as __QRCode from 'davidshimjs-qrcodejs';
const QRCode: QRCodeConstructor = __QRCode;
@Component({
selector: 'tide-qrcode',
template: '',
@Dominent
Dominent / RSF.ts
Last active November 22, 2019 10:47
interface IPayload<T> {
payload: T;
}
class Payload {
public static empty: IPayload<{}> = { payload: null } as IPayload<{}>;
}
interface IHttpTypedAction<R, S, F> {
request: ActionCreator<string, (props: IPayload<R>) => IPayload<R> & TypedAction<string>>;
@Dominent
Dominent / grid.scss
Last active September 25, 2019 10:04
/* breakpoints */
$grid-bp-xs: 0;
$grid-bp-sm: 576;
$grid-bp-md: 768;
$grid-bp-lg: 992;
$grid-bp-xl: 1200;
/* columns */
$grid-cols: 12;
import { Component, OnInit } from '@angular/core';
import WebSocketMessage from './WebSocketMessage';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent implements OnInit {
public code: string;
using System;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using CloudSoft.MessageBus.Client;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.Logging;
using Microsoft.Extensions.DependencyInjection;
using Newtonsoft.Json;
static class LevenshteinDistance
{
/// <summary>
/// Compute the distance between two strings.
/// </summary>
public static int Compute(string s, string t)
{
int n = s.Length;
int m = t.Length;
int[,] d = new int[n + 1, m + 1];
class Program
{
static void Main(string[] args)
{
var model = new Test() { };
var validator = new Validator<Test>();
var result = new Validator<Test>()
.AddRule(t => t.Name, new ValidatorNameRule())
.Validate(model);