Skip to content

Commit ba0f3df

Browse files
committed
prompt QA done
1 parent 2e518cf commit ba0f3df

File tree

2 files changed

+1
-24
lines changed

2 files changed

+1
-24
lines changed

fern/docs.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,6 @@ navigation:
695695
- page: Prompt A Structured Q&A Response Using LLM Gateway
696696
path: pages/05-guides/cookbooks/lemur/task-endpoint-structured-QA.mdx
697697
slug: task-endpoint-structured-QA
698-
hidden: true
699698
- page: Estimate Input Token Costs for LLM Gateway
700699
path: pages/05-guides/cookbooks/lemur/counting-tokens.mdx
701700
slug: counting-tokens

fern/pages/05-guides/cookbooks/lemur/task-endpoint-structured-QA.mdx

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ while True:
209209
time.sleep(3)
210210
```
211211

212-
Construct a formatted string to structure the questions. This includes the question text, context, an answer format, and any answer options, then returns the formatted string.
212+
Construct a formatted string to structure the questions. This includes the question text, context, an answer format, any answer options, then returns the formatted string.
213213

214214
```python
215215
# -------------------------------
@@ -506,28 +506,6 @@ llm_output = response_json["choices"][0]["message"]["content"]
506506

507507
Clean the XML output and print the question and answer pairs.
508508

509-
```python
510-
# -------------------------------
511-
# Step 5: Query LLM Gateway
512-
# -------------------------------
513-
headers = {"authorization": API_KEY}
514-
515-
response = requests.post(
516-
"https://llm-gateway.assemblyai.com/v1/chat/completions",
517-
headers=headers,
518-
json={
519-
"model": "claude-sonnet-4-5-20250929",
520-
"messages": [{"role": "user", "content": prompt}],
521-
"max_tokens": 2000,
522-
},
523-
)
524-
525-
response_json = response.json()
526-
llm_output = response_json["choices"][0]["message"]["content"]
527-
```
528-
529-
Clean the XML output and print the question and answer pairs.
530-
531509
```python
532510
# -------------------------------
533511
# Step 6: Parse and print XML response

0 commit comments

Comments
 (0)