Skip to content

Commit

Permalink
Added a Usage Sample
Browse files Browse the repository at this point in the history
  • Loading branch information
honnuanand committed Nov 27, 2023
1 parent 8c8c59b commit c2cc94e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,23 @@ aws.bedrock.model.llama2.temperature=0.5

```

### Usage
Once activated the Service can be autowired and used as below.

```Java
private final ClaudeService claudeService;

@Autowired
public ClaudeController(ClaudeService claudeService) {
this.claudeService = claudeService;
}

@GetMapping("/invoke")
public String invokeClaude(@RequestParam String prompt) {
try {
return claudeService.invokeClaude(prompt);
} catch (Exception e) {
return "Error invoking Claude: " + e.getMessage();
}
}
```

0 comments on commit c2cc94e

Please sign in to comment.