-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest_ai_model.py
More file actions
29 lines (26 loc) · 885 Bytes
/
test_ai_model.py
File metadata and controls
29 lines (26 loc) · 885 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
"""
Simple test file to trigger AI scanner detection.
"""
import openai
from openai import OpenAI
# This should be detected by the AI scanner
client = OpenAI(api_key="placeholder_key")
def generate_text():
"""Generate text using GPT-4."""
response = client.chat.completions.create(
model="gpt-4",
messages=[
{"role": "system", "content": "You are a helpful assistant."},
{"role": "user", "content": "What is artificial intelligence?"}
],
max_tokens=100
)
return response.choices[0].message.content
# This function should also be detected
def create_embedding():
"""Create an embedding using OpenAI's embedding model."""
response = client.embeddings.create(
model="text-embedding-3-large",
input="The quick brown fox jumps over the lazy dog."
)
return response.data[0].embedding