Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/Strexas/kath
Browse files Browse the repository at this point in the history
  • Loading branch information
Dainius Kirsnauskas committed May 28, 2024
2 parents fd5ae0f + 900f025 commit 8a5d301
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
6 changes: 3 additions & 3 deletions GUI/back-end/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
app.register_blueprint(router_bp('/api/v1'))

# Configurations
cors = CORS(app, origins=origins)
cors = CORS(app, resources={r"/*": {"origins": "*"}})


@app.route('/api/v1/request', methods=['POST'])
Expand All @@ -48,7 +48,7 @@ def process():
return ''

with open("key") as f:
openai.api_key = f.readline()
openai.api_key = f.readline().strip()

discussions = [{"role": "system", "content": "I guessed number 5"}]
discussions.append({"role": "user", "content": request_data})
Expand Down Expand Up @@ -77,4 +77,4 @@ def process():

# Run the app
if __name__ == '__main__':
app.run(debug=True, port=8080)
app.run(debug=True, host='0.0.0.0', port=8080)
2 changes: 1 addition & 1 deletion GUI/front-end/.env.development
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VITE_API_URL=http://localhost:8080/api/v1
VITE_API_URL=http://34.29.163.210:8080/api/v1
5 changes: 4 additions & 1 deletion GUI/front-end/src/components/displays/chat/ChatDisplay.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,13 @@ export const ChatDisplay: React.FC<Props> = () => {
]);

const responseResult = await sendRequest.mutateAsync(content);
setIsInputDisabled(false);

const formatedResponse = responseResult.replace(/(?:\r\n|\r|\n)/g, '<br>');

setChatInstances((prevInstances) => [
...prevInstances,
<ChatInstance icon={<KathLogo />} author={applicationContext.name} content={responseResult} />,
<ChatInstance icon={<KathLogo />} author={applicationContext.name} content={formatedResponse} />,
]);

// Temporary mock up response
Expand Down

0 comments on commit 8a5d301

Please sign in to comment.