MCPcopy
hub / github.com/algorithmicsuperintelligence/optillm / extract_contents

Function extract_contents

optillm/server.py:580–593  ·  view source on GitHub ↗
(response_obj)

Source from the content-addressed store, hash-verified

578 yield "data: [DONE]\n\n"
579
580def extract_contents(response_obj):
581 contents = []
582 # Handle both single response and list of responses
583 responses = response_obj if isinstance(response_obj, list) else [response_obj]
584
585 for response in responses:
586 # Extract content from first choice if it exists
587 if (response.get('choices') and
588 len(response['choices']) > 0 and
589 response['choices'][0].get('message') and
590 response['choices'][0]['message'].get('content')):
591 contents.append(response['choices'][0]['message']['content'])
592
593 return contents
594
595def parse_conversation(messages):
596 system_prompt = ""

Callers 1

proxyFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected