charonn0 / Xojo-OpenAI

A Xojo API for interacting with OpenAI
MIT License
16 stars 6 forks source link

Demo Project: Incomplete Reply #2

Closed Schneppi closed 1 year ago

Schneppi commented 1 year ago

Using the Demo Project, if i use a german spelled natural language prompt, the reply is incomplete.

As an example, try to enter the prompt: "Welchen Öffnungswinkel erreichen WLAN Antennen?"

The Reply will show something like "

Der Öffnungswinkel einer WLAN-Antenne hängt von der Art der Antenne ab. Für Richtantennen liegt er normalerweise zwischen 30 und 60 Grad, während Sektor- oder Yagi-"

As we can see, it stops after "Yagi-", but the complete reply must be more.

charonn0 commented 1 year ago

Try increasing the token count (AKA "MaxTokens") for the request. The default is 64 tokens, but it looks like that reply consumes 62 tokens (see: token count estimator). 128 tokens will probably be enough.

Note that the API charges by token count ($0.02/ 1K tokens for the davinci text completion model.)

https://help.openai.com/en/articles/4936856-what-are-tokens-and-how-to-count-them