Skip to content

Commit

Permalink
docs: udpate samples
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Jul 21, 2023
1 parent 566e317 commit 0ae1f34
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/develop-llm-app-best-practise.md
Original file line number Diff line number Diff line change
Expand Up @@ -310,6 +310,8 @@ await fetch("/api/action/tooling", {

### 服务端实现转发: Java + Spring

WebFlux + Spring Boot

```java
@RestController
public class ChatController {
Expand All @@ -333,6 +335,8 @@ public class ChatController {

### 服务端转发:Python

FastAPI + OpenAI

```python

app = FastAPI()
Expand Down Expand Up @@ -363,12 +367,7 @@ def generate_reply_stream(input_data: ChatInput):
temperature=temperature,
max_tokens=max_tokens,
n=max_responses,
top_p=1,
frequency_penalty=0,
presence_penalty=0,
messages=[
{"role": "system",
"content": "You are an expert creative marketer. Create a campaign for the brand the user enters."},
{"role": "user", "content": prompt},
],
stream=True,
Expand Down

0 comments on commit 0ae1f34

Please sign in to comment.