vsegptv2
Browse files
app.py
CHANGED
@@ -1,5 +1,6 @@
|
|
1 |
import language_tool_python
|
2 |
import openai
|
|
|
3 |
import streamlit as st
|
4 |
import subprocess
|
5 |
from pathlib import Path
|
@@ -84,7 +85,7 @@ def generate_gpt_comment_openai(inp):
|
|
84 |
|
85 |
|
86 |
def generate_gpt_comment_vsegpt(inp):
|
87 |
-
client =
|
88 |
api_key='sk-or-vv-44ca318747a45e810149bf769e9dfbe5f42046695875efd7c9121cca590d6906',
|
89 |
base_url='https://api.vsegpt.ru/v1'
|
90 |
)
|
@@ -114,7 +115,7 @@ def check_text(text, tool):
|
|
114 |
error_info = {
|
115 |
'start': match.offset,
|
116 |
'end': match.offset + match.errorLength,
|
117 |
-
'message': generate_gpt_comment(inp, client_name="
|
118 |
}
|
119 |
errors.append(error_info)
|
120 |
|
|
|
1 |
import language_tool_python
|
2 |
import openai
|
3 |
+
from openai import OpenAI
|
4 |
import streamlit as st
|
5 |
import subprocess
|
6 |
from pathlib import Path
|
|
|
85 |
|
86 |
|
87 |
def generate_gpt_comment_vsegpt(inp):
|
88 |
+
client = OpenAI(
|
89 |
api_key='sk-or-vv-44ca318747a45e810149bf769e9dfbe5f42046695875efd7c9121cca590d6906',
|
90 |
base_url='https://api.vsegpt.ru/v1'
|
91 |
)
|
|
|
115 |
error_info = {
|
116 |
'start': match.offset,
|
117 |
'end': match.offset + match.errorLength,
|
118 |
+
'message': generate_gpt_comment(inp, client_name="vsegpt"),
|
119 |
}
|
120 |
errors.append(error_info)
|
121 |
|