alblack52 0.0.17__tar.gz → 0.0.18__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alblack52
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: This is the simplest module for quick work with files.
5
5
  Author: __token__
6
6
  Author-email: mihajlovic.aleksa@gmail.com
@@ -0,0 +1,58 @@
1
+ import requests
2
+
3
+ API_URL = "https://api.deepinfra.com/v1/openai/chat/completions"
4
+ API_TOKEN = 'jwt:eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiJnaDoxNjY1MzcyMzkiLCJleHAiOjE3NTMzNTQwNzV9.QKdE15memSb9qkqpTnO-PDP-p7NU0ymmaqTpc-YY_7s'
5
+
6
+ # fjkbsfbkjsbdfs
7
+
8
+ def ask_phind(messages):
9
+ headers = {
10
+ "Authorization": f"Bearer {API_TOKEN}",
11
+ "Content-Type": "application/json"
12
+ }
13
+ data = {
14
+ "model": "deepseek-ai/DeepSeek-R1-0528",
15
+ "messages": messages
16
+ }
17
+ response = requests.post(API_URL, headers=headers, json=data)
18
+
19
+ if response.status_code == 200:
20
+ response_json = response.json()
21
+
22
+ try:
23
+ return response_json["choices"][0]["message"]["content"]
24
+ except (KeyError, IndexError) as e:
25
+ return "Error: Unable to extract response content. Please check the response structure."
26
+ else:
27
+ return f"Error: {response.status_code}, {response.text}"
28
+
29
+
30
+ def chat_with_phind():
31
+ conversation_history = [
32
+ {"role": "system", "content": '''
33
+ Ты - эксперт в машинном обучении. Отвечай подробно и доходчиво.
34
+ '''},
35
+
36
+ ]
37
+
38
+ while True:
39
+ question = input("You: ")
40
+ if question.lower() == 'exit':
41
+ print("Goodbye!")
42
+ break
43
+
44
+ conversation_history.append({"role": "user", "content": question})
45
+
46
+ answer = ask_phind(conversation_history)
47
+
48
+ conversation_history.append({"role": "assistant", "content": answer})
49
+
50
+ print("Ответ: " + answer)
51
+
52
+
53
+ def start():
54
+ chat_with_phind()
55
+
56
+
57
+ if __name__ == "__main__":
58
+ chat_with_phind()
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: alblack52
3
- Version: 0.0.17
3
+ Version: 0.0.18
4
4
  Summary: This is the simplest module for quick work with files.
5
5
  Author: __token__
6
6
  Author-email: mihajlovic.aleksa@gmail.com
@@ -8,6 +8,7 @@ alblack52/kudr.py
8
8
  alblack52/layers.py
9
9
  alblack52/loggingin.py
10
10
  alblack52/mikh.py
11
+ alblack52/ml.py
11
12
  alblack52/speedfilein.py
12
13
  alblack52/style.py
13
14
  alblack52/tensorclass.py
@@ -8,7 +8,7 @@ def readme():
8
8
 
9
9
  setup(
10
10
  name='alblack52',
11
- version='0.0.17',
11
+ version='0.0.18',
12
12
  author='__token__',
13
13
  description='This is the simplest module for quick work with files.',
14
14
  packages=['alblack52'],
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes