formatting

This commit is contained in:
Ian Webster
2023-07-13 17:18:57 -07:00
parent ddc370cbf6
commit af994ffbc7
3 changed files with 5 additions and 4 deletions

View File

@@ -1,8 +1,9 @@
This example shows how to run a Python (LangChain) chain implementation with Promptfoo. It compares GPT-4 versus LangChain's LLM Math module.
This example shows how to run a Python (LangChain) chain implementation with Promptfoo. It compares GPT-4 versus LangChain's LLM Math module.
To run it, first create a virtual env and install the requirements:
Then activate the virtual env.
```
python3 -m venv venv
source venv/bin/activate
@@ -10,7 +11,7 @@ pip install -r requirements.txt
```
Then run the eval:
```
npx promptfoo eval
```

View File

@@ -25,7 +25,7 @@ export class AnthropicCompletionProvider implements ApiProvider {
constructor(modelName: string, apiKey?: string, context?: AnthropicCompletionOptions) {
this.modelName = modelName;
this.apiKey = apiKey || process.env.ANTHROPIC_API_KEY;
this.anthropic = new Anthropic({apiKey: this.apiKey});
this.anthropic = new Anthropic({ apiKey: this.apiKey });
this.options = context || {};
}

View File

@@ -79,7 +79,7 @@ describe('providers', () => {
const provider = new AnthropicCompletionProvider('claude-1', 'test-api-key');
provider.anthropic.completions.create = jest.fn().mockResolvedValue({
completion: 'Test output',
})
});
const result = await provider.callApi('Test prompt');
expect(provider.anthropic.completions.create).toHaveBeenCalledTimes(1);