You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
text = response['choice'][0]['text']
page.horizontal_alignment = ft.CrossAxisAlignment.END
page. Add(ft. Row[
(
ft. Text("Chat GPT: "),
text
)
])
`ft.app(target=main)``
you can use ur API, idk how to fix this problem whene i run the code: ''''openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.'''''
This discussion was converted from issue #1520 on June 25, 2023 02:55.
Heading
Bold
Italic
Quote
Code
Link
Numbered list
Unordered list
Task list
Attach files
Mention
Reference
Menu
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
`import os
import openai
import flet as ft
openai.api_key = os.getenv("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")
def main(page: ft.Page):
page.theme_mode = ft.ThemeMode.LIGHT
page.scroll = True
page.scroll_to = ft.ScrollMode.HIDDEN
Ask = ft.TextField(hint_text="Ask me anythinks")
response = openai.Completion.create(
model="text-davinci-003",
prompt=Ask,
temperature=0.9,
max_tokens=150,
top_p=1,
frequency_penalty=0.0,
presence_penalty=0.6,
)
text = response['choice'][0]['text']
page.horizontal_alignment = ft.CrossAxisAlignment.END
page. Add(ft. Row[
(
ft. Text("Chat GPT: "),
text
)
])
`ft.app(target=main)``
you can use ur API, idk how to fix this problem whene i run the code: ''''openai.error.AuthenticationError: No API key provided. You can set your API key in code using 'openai.api_key = ', or you can set the environment variable OPENAI_API_KEY=). If your API key is stored in a file, you can point the openai module at it with 'openai.api_key_path = '. You can generate API keys in the OpenAI web interface. See https://platform.openai.com/account/api-keys for details.'''''
plz help me to build a chat app with AI
Beta Was this translation helpful? Give feedback.
All reactions