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
{ | |
"model": "gpt-4", | |
"tools": [ | |
{ | |
"type": "function", | |
"function": { | |
"name": "get_weather", | |
"description": "Get the current weather at a specific location", | |
"parameters": { | |
"type": "object", |
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 { Controller, Get, UseGuards } from '@nestjs/common'; | |
import { AuthGuard } from '../auth/auth.guard'; | |
@UseGuards(AuthGuard) | |
@Controller() | |
export class BusinessController { | |
/** | |
* This endpoint costs 1 credit per call | |
*/ |
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 { HttpService, Injectable } from '@nestjs/common'; | |
import { map } from 'rxjs/operators'; | |
import * as jwt from 'jsonwebtoken'; | |
import { AuthenticationStrategy, KeycloakUserInfoResponse } from '../authentication.strategy'; | |
export class InvalidTokenPublicKeyId extends Error { | |
constructor(keyId: string) { | |
super(`Invalid public key ID ${keyId}`); | |
} |
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 { HttpModule, Module } from '@nestjs/common'; | |
import { AuthenticationGuard } from './authentication.guard'; | |
import { AuthenticationService } from './authentication.service'; | |
import { AUTHENTICATION_STRATEGY_TOKEN } from './authentication.strategy'; | |
import { KeycloakAuthenticationStrategy } from './strategy/keycloak.strategy'; | |
@Module({ | |
imports: [ | |
HttpModule, |
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 { HttpModule, Module } from '@nestjs/common'; | |
import { AuthenticationGuard } from './authentication.guard'; | |
import { AuthenticationService } from './authentication.service'; | |
import { AUTHENTICATION_STRATEGY_TOKEN } from './authentication.strategy'; | |
import { KeycloakAuthenticationStrategy } from './strategy/keycloak.strategy'; | |
import { FakeAuthenticationStrategy } from './strategy/fake.strategy'; | |
@Module({ | |
imports: [ |
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 { Module } from '@nestjs/common'; | |
import { AppController } from './app.controller'; | |
import { AppService } from './app.service'; | |
import { AuthenticationModule } from './authentication/authentication.module'; | |
@Module({ | |
imports: [ | |
AuthenticationModule, | |
], |
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 { | |
CACHE_MANAGER, | |
CacheModule as BaseCacheModule, | |
Inject, | |
Logger, | |
Module, | |
OnModuleInit, | |
} from '@nestjs/common'; | |
import * as redisStore from 'cache-manager-ioredis'; | |
import { Cache} from 'cache-manager'; |
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 { Body, Controller, Get, Put } from '@nestjs/common'; | |
import { AppService } from './app.service'; | |
@Controller('/hello') | |
export class AppController { | |
constructor( | |
private readonly appService: AppService, | |
) {} |
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 { Logger, Module, OnModuleInit } from '@nestjs/common'; | |
import { ElasticsearchModule as BaseElasticsearchModule, ElasticsearchService } from '@nestjs/elasticsearch'; | |
import { v4 as uuid }from 'uuid'; | |
@Module({ | |
imports: [ | |
BaseElasticsearchModule.register({ | |
node: 'http://localhost:9200', | |
generateRequestId: () => uuid(), | |
}), |
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 { Module, OnModuleInit } from '@nestjs/common'; | |
import { ElasticsearchModule as BaseElasticsearchModule, ElasticsearchService } from '@nestjs/elasticsearch'; | |
import { v4 as uuid }from 'uuid'; | |
@Module({ | |
imports: [ | |
BaseElasticsearchModule.register({ | |
node: 'http://localhost:9200', | |
generateRequestId: () => uuid(), | |
}), |
NewerOlder