Skip to content

Commit

Permalink
feat/adding support for palm2 api
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Raghuwanshi committed Feb 21, 2024
1 parent 688bc0b commit b8b4f69
Show file tree
Hide file tree
Showing 6 changed files with 648 additions and 10 deletions.
39 changes: 39 additions & 0 deletions JS/edgechains/examples/testcases/Palm2AiEndpoints.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { Palm2AiEndpoint } from "../../lib/src/lib/endpoints/Palm2AiEndpoint";

describe('Palm2AiEndpoint', () => {
test('should return the expected response for a given prompt', async () => {
const apiKey = 'AIzaSyB2Cc5yX0q5HCOgMWtdsh5mALBorAiLlxE';
const model = 'models/text-bison-001';
const temperature = 0.7;

const palm2AiEndpoint = new Palm2AiEndpoint(apiKey, model, temperature);

// const response = await palm2AiEndpoint.chatFun(promptText)
expect(await palm2AiEndpoint.chatFun("how many states in Inida")).toBe('28');
});
});
describe('Palm2AiEndpoint', () => {
test('should return the expected response for a given prompt', async () => {
const apiKey = 'AIzaSyB2Cc5yX0q5HCOgMWtdsh5mALBorAiLlxE';
const model = 'models/text-bison-001';
const temperature = 0.7;

const palm2AiEndpoint = new Palm2AiEndpoint(apiKey, model, temperature);

// const response = await palm2AiEndpoint.chatFun(promptText)
expect(await palm2AiEndpoint.chatFun("Pm of india")).toBe('NarendraModi');
});
});

describe('Palm2AiEndpoint', () => {
test('should return the expected response for a given prompt', async () => {
const apiKey = 'AIzaSyB2Cc5yX0q5HCOgMWtdsh5mALBorAiLlxE';
const model = 'models/text-bison-001';
const temperature = 0.7;

const palm2AiEndpoint = new Palm2AiEndpoint(apiKey, model, temperature);

// const response = await palm2AiEndpoint.chatFun(promptText)
expect(await palm2AiEndpoint.chatFun("smallest 2 digit value")).toBe('10');
});
});
Loading

0 comments on commit b8b4f69

Please sign in to comment.