Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Yiyun-Liang committed Jun 30, 2024
1 parent fbe44c2 commit fcd6be5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions python/sglang/backend/openai.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ def generate(
"Example of adding api speculative execution: @function(num_api_spec_tokens=128)."
)
prompt = s.messages_
# Open AI model requires function call information to be sent to the model
# along with the prompt.
for function_call in s.function_calls:
prompt.append(function_call)
else:
Expand Down
2 changes: 2 additions & 0 deletions python/sglang/lang/interpreter.py
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,8 @@ def text(self):
return self.stream_executor.text()

def messages(self):
# We do not want to expose tool use information to users in the final response,
# so removing the auxillary information from final messages.
filtered_list = [
item
for item in self.stream_executor.messages()
Expand Down

0 comments on commit fcd6be5

Please sign in to comment.