#Get text only(java)

6 messages · Page 1 of 1 (latest)

dusk current
#

Hello, im working on a small project in java and i would like to ask, is it possible to get only text from generation? The part of the code with generation looks like this.

#

and what i want is this(without the "text=")

gaunt maple
#

im assuming it'll be something along these lines, but I don't know java so I'm not 100% sure.

In python its ```py
text = response['choices'][0]['text']
print(text)


So in java, i want to assume its something along the lines of ```java
string text = response['choices'][0]['text']
``` or something like that. I'm not too sure. but if you're skilled enough in java it shouldn't be too hard to change it from python -> java
plain mauve
#

Yes, that's right, the text is always stored in the same place in the JSON dictionary that's returned, regardless of the language

dusk current
#

i figured it out somehow and its working