-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Open
Labels
Description
Description
Perplexity AI has a citations field in their response that usually works like this
response_stream = client.chat.completions.create(
model="sonar-pro",
messages=messages,
stream=True,
)
citations = []
for response in response_stream:
print(response.choices[0].delta.content, end="")
citations.extend(response.citations)
You now have access to a list of citations that you can use reliably.
Is there any way in pydantic_ai to access this?
The perplexity model is not very reliable at producing inline citations. So it would be useful to be able to do this and access their citations.
stuartmaxwell and DanKing1903