Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commit/api/api_explorer.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def get_apis_for_project(project_branch: str):

apis = json.loads(branch_doc.whitelisted_apis).get("apis", []) if branch_doc.whitelisted_apis else []
documentation = json.loads(branch_doc.documentation).get("apis", []) if branch_doc.documentation else []
# print('documentation', len(documentation))
print('documentation', len(documentation))
for api in apis:
# find the documentation for the api whose function_name equals to name and path same as path
for doc in documentation:
Expand Down
3 changes: 1 addition & 2 deletions commit/api/generate_documentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

def generate_docs_for_apis(api_definitions):

max_tokens_per_request = 10000 # This is a safe limit to avoid hitting the max token limit
max_tokens_per_request = 1800 # This is a safe limit to avoid hitting the max token limit
chunks = chunk_data(api_definitions, max_tokens_per_request)
all_docs = []

Expand Down Expand Up @@ -84,7 +84,6 @@ def generate_docs_for_chunk(api_chunk):
cleaned_response = clean_response(response_text)

try:
print(f"Type of cleaned_response: {type(cleaned_response)}")
# Check if cleaned_response is already a list (or the expected type)
if isinstance(cleaned_response, list):
return cleaned_response
Expand Down
7 changes: 3 additions & 4 deletions commit/commit/doctype/open_ai_settings/open_ai_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,9 @@ def open_ai_call(message):
response = client.chat.completions.create(
model="gpt-3.5-turbo",
messages=message,
max_tokens=2500, # Adjust max tokens as needed
n=1,
stop=None,
temperature=0.5,
max_tokens=3900,
temperature=0.3, # Lower temperature for more deterministic output
stop=["Function Name:", "\n\n"] # Stop sequence to separate functions
)

return response.choices[0].message.content